Commit e014da83 authored by dobli's avatar dobli
Browse files

add folds for vim

parent a2dd6d05
Showing with 25 additions and 7 deletions
+25 -7
...@@ -11,7 +11,7 @@ CONFIG_DIRS = [ ...@@ -11,7 +11,7 @@ CONFIG_DIRS = [
# ****************************** # ******************************
# Config file functions # Config file functions {{{
# ****************************** # ******************************
def generate_config_folders(base_path): def generate_config_folders(base_path):
"""Generate folders for configuration files """Generate folders for configuration files
...@@ -24,8 +24,11 @@ def generate_config_folders(base_path): ...@@ -24,8 +24,11 @@ def generate_config_folders(base_path):
os.makedirs(new_dir) os.makedirs(new_dir)
# }}}
# ****************************** # ******************************
# Docker machine functions # Docker machine functions {{{
# ****************************** # ******************************
def get_machine_list(): def get_machine_list():
"""Get a list of docker machine names using the docker-machine system command """Get a list of docker machine names using the docker-machine system command
...@@ -43,7 +46,7 @@ def check_machine_exists(machine_name): ...@@ -43,7 +46,7 @@ def check_machine_exists(machine_name):
"""Checks weather a docker machine exists and is available """Checks weather a docker machine exists and is available
:machine_name: Name of the machine to check :machine_name: Name of the machine to check
:returns: TODO :returns: True when machine is available
""" """
machines = get_machine_list() machines = get_machine_list()
...@@ -72,8 +75,11 @@ def get_machine_env(machine_name): ...@@ -72,8 +75,11 @@ def get_machine_env(machine_name):
return machine_envs return machine_envs
# }}}
# ****************************** # ******************************
# Docker client commands # Docker client commands {{{
# ****************************** # ******************************
def assign_label_to_node(nodeid, label, value): def assign_label_to_node(nodeid, label, value):
"""Assigns a label to a node (e.g. building) """Assigns a label to a node (e.g. building)
...@@ -128,8 +134,11 @@ def run_command_in_service(service, command, building=None): ...@@ -128,8 +134,11 @@ def run_command_in_service(service, command, building=None):
client.close() client.close()
# }}}
# ****************************** # ******************************
# CLI base commands and main # CLI base commands {{{
# ****************************** # ******************************
def init_config_dirs_command(args): def init_config_dirs_command(args):
"""Initialize config directories """Initialize config directories
...@@ -198,8 +207,11 @@ def interactive_command(args): ...@@ -198,8 +207,11 @@ def interactive_command(args):
print(main_menu()) print(main_menu())
# }}}
# ****************************** # ******************************
# Interactive menu entries # Interactive menu entries {{{
# ****************************** # ******************************
def main_menu(): def main_menu():
""" Display main menu """ Display main menu
...@@ -244,8 +256,10 @@ def init_menu(): ...@@ -244,8 +256,10 @@ def init_menu():
print(answers) print(answers)
# }}}
# ****************************** # ******************************
# Script main (entry) # Script main (entry) {{{
# ****************************** # ******************************
if __name__ == '__main__': if __name__ == '__main__':
import argparse import argparse
...@@ -307,3 +321,7 @@ if __name__ == '__main__': ...@@ -307,3 +321,7 @@ if __name__ == '__main__':
args = parser.parse_args() args = parser.parse_args()
args.func(args) args.func(args)
# }}}
# --- vim settings ---
# vim:foldmethod=marker:foldlevel=0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment