def set_alias(name, address, user=None, password=None): key = 'dockyard/aliases/{name}'.format(**locals()) value = {'address': address} if user: value['user'] = user if password: value['password'] = password will_be_default = len(get_list()) <= 1 and name != DOCKYARD_FALLBACK_ALIAS kv.set(key, value) if will_be_default: set_default(name)
def set_alias(name, address, user=None, password=None, check_if_accessible=True): if check_if_accessible: header = " Warning!\n Your dockyard alias has been set BUT:" print_dockyard_unavailability_warning(address, user, password, header) key = 'dockyard/aliases/{name}'.format(**locals()) value = {'address': address} if user: value['user'] = user if password: value['password'] = password will_be_default = len(get_list()) <= 1 and name != DOCKYARD_FALLBACK_ALIAS kv.set(key, value) if will_be_default: set_default(name)
def set_default(name): kv.set('dockyard/default', name)
def set_initialized(): kv.set('dockyard/initialized', '1')
def _save_containers_parameters_list_in_kv_store(containers_parameters_list): ship_name = get_ship_name() kv.set('containers_parameters_list/{ship_name}'.format(**locals()), containers_parameters_list)