0.1.x standalone alba update#228
Conversation
src/update/alba_component_update.py
Outdated
|
|
||
| :return: None | ||
| """ | ||
| version = max([LooseVersion(i) for i in os.listdir(cls.alba_binary_base_path) if cls.re_alba_binary.match(i)]) |
There was a problem hiding this comment.
What is there is nothing here?
src/update/alba_component_update.py
Outdated
| :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)))]) |
There was a problem hiding this comment.
os.path.join and formatting with a '/'? Nice
src/update/alba_component_update.py
Outdated
| :return: str | ||
| """ | ||
| node_id = cls.get_node_id() | ||
| return check_output(['arakoon', '--drop-master', node_id, '127.0.0.1', 'port']) |
…nges pretified the use of paths
…e/framework-extensions into 0.1.x_standalone_alba_update
…egular symlinking. This mimics the alba update code
src/update/alba_component_update.py
Outdated
|
|
||
| ## Pathing variables | ||
| OPT = os.path.join(os.path.sep, 'opt') | ||
| ALBA_OPT_PATH = os.path.join(os.path.sep, OPT, '{0}') |
There was a problem hiding this comment.
No need for the first os.path.sep here. Already included in OPT
src/update/alba_component_update.py
Outdated
| 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') |
There was a problem hiding this comment.
os.path.sep already included in USR
src/update/alba_component_update.py
Outdated
| 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') |
src/update/alba_component_update.py
Outdated
| Retrieve a persistent client which needs | ||
| Needs to be implemented by the callee | ||
| """ | ||
| raise NotImplementedError() |
There was a problem hiding this comment.
No need to overwrite. It will force the implementation upon inheritors
src/update/alba_component_update.py
Outdated
| def get_node_id(cls): | ||
| """ | ||
| Fetch the local id. should be implemented by ovs or the asd manager | ||
| :return: |
src/update/alba_component_update.py
Outdated
| from ovs_extensions.db.arakoon.arakooninstaller import ArakoonClusterConfig | ||
| from StringIO import StringIO | ||
|
|
||
| logger = logging.getLogger(__name__) |
There was a problem hiding this comment.
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)
src/update/alba_component_update.py
Outdated
| 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): |
There was a problem hiding this comment.
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]] |
There was a problem hiding this comment.
Change to alba iso alba-ee. Apt-get will pull in alba-ee as they both provide 'alba'
Alba is not resolved by the package manager correctly, therefore hardcoded -ee is needed
No description provided.