Skip to content

0.1.x standalone alba update#228

Merged
sjovdnbos merged 13 commits into0.1.x_standalone_updatefrom
0.1.x_standalone_alba_update
Jul 2, 2019
Merged

0.1.x standalone alba update#228
sjovdnbos merged 13 commits into0.1.x_standalone_updatefrom
0.1.x_standalone_alba_update

Conversation

@sjovdnbos
Copy link
Contributor

No description provided.

@JeffreyDevloo JeffreyDevloo changed the base branch from develop to 0.1.x_standalone_update June 21, 2019 09:15

:return: None
"""
version = max([LooseVersion(i) for i in os.listdir(cls.alba_binary_base_path) if cls.re_alba_binary.match(i)])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is there is nothing here?

:return: None
"""
version = max([LooseVersion(i) for i in os.listdir(cls.alba_binary_base_path) if cls.re_alba_binary.match(i)])
check_output(['update-alternatives', '--set', 'alba', os.path.join('{0}/{1}'.format(cls.alba_binary_base_path, str(version)))])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

os.path.join and formatting with a '/'? Nice

:return: str
"""
node_id = cls.get_node_id()
return check_output(['arakoon', '--drop-master', node_id, '127.0.0.1', 'port'])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which port?

@JeffreyDevloo JeffreyDevloo changed the base branch from 0.1.x_standalone_update to 0.1.x_update_pyrakoon June 28, 2019 06:09
@JeffreyDevloo JeffreyDevloo changed the base branch from 0.1.x_update_pyrakoon to 0.1.x_standalone_update June 28, 2019 06:09

## Pathing variables
OPT = os.path.join(os.path.sep, 'opt')
ALBA_OPT_PATH = os.path.join(os.path.sep, OPT, '{0}')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the first os.path.sep here. Already included in OPT

ALBA_OPT_NSM_PLUGIN_PATH = os.path.join(os.path.sep, ALBA_OPT_PATH, 'plugin', 'nsm_host_plugin.cmxs')

USR = os.path.join(os.path.sep, 'usr')
ALBA_BIN_PATH = os.path.join(os.path.sep, USR, 'bin', 'alba')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

os.path.sep already included in USR

ARAKOON_BIN_PATH = os.path.join(os.path.sep, USR, 'bin', 'arakoon')

ALBA_LIB_PATH = os.path.join(os.path.sep, USR, 'lib', 'alba')
ALBA_LIB_ABM_PLUGIN_PATH = os.path.join(os.path.sep, ALBA_LIB_PATH, 'albamgr_plugin.cmxs')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing

Retrieve a persistent client which needs
Needs to be implemented by the callee
"""
raise NotImplementedError()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to overwrite. It will force the implementation upon inheritors

def get_node_id(cls):
"""
Fetch the local id. should be implemented by ovs or the asd manager
:return:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docstrings?

from ovs_extensions.db.arakoon.arakooninstaller import ArakoonClusterConfig
from StringIO import StringIO

logger = logging.getLogger(__name__)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the logger bound to the class. That way we can overwrite the logging (as the 0.1.x branch does not support the default python logging)

logger.info('Updating alternatives')
alba_versions = cls.get_local_alba_versions()
latest_alba_version = [(k, v) for k, v in alba_versions.iteritems() if v == max(alba_versions.values())][0]
if not os.path.islink(cls.ALBA_BIN_PATH):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to check that the path exists too

"""

COMPONENT = 'alba'
BINARIES = [(['alba-ee'], 'alba', '/usr/bin/alba', [])] # List with tuples. [(package_name, binary_name, binary_location, [service_prefix_0]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to alba iso alba-ee. Apt-get will pull in alba-ee as they both provide 'alba'

Simon Van den Bossche added 2 commits June 28, 2019 12:37
Alba is not resolved by the package manager correctly, therefore hardcoded -ee
is needed
@sjovdnbos sjovdnbos merged commit 559b1c1 into 0.1.x_standalone_update Jul 2, 2019
@JeffreyDevloo JeffreyDevloo deleted the 0.1.x_standalone_alba_update branch July 15, 2019 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants