Eclectic Media Git eclecti_deploy / 6f30bdc
Various documentation fixes in modules Ariana Giroux 1 year, 4 months ago
2 changed file(s) with 12 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
1313
1414
1515 def __get_config(config_path='.deploy.yml'):
16 """ Loads config_data from :term:`.deploy` files.
16 """ Loads config_data from :term:`.deploy.yml` files.
1717
18 :param str config_path: The path to the :term:`.deploy` file
18 :param str config_path: The path to the :term:`.deploy.yml` file
1919 :returns: The configuration values
2020 :rtype: Dictionary
21 :raises ValueError: if ``config_path`` does not end in a :term:`.deploy` file
22 :raises FileNotFoundError: if there is no file named :term:`.deploy` in the
21 :raises ValueError: if ``config_path`` does not end in a :term:`.deploy.yml` file
22 :raises FileNotFoundError: if there is no file named :term:`.deploy.yml` in the
2323 current directory
2424 """
2525 if not os.path.split(config_path)[-1].count('.deploy' and '.yml'):
3333 def __parse_keys(template_yml, user_yml, template_path=None):
3434 """ Recurses through template and user config files, looking for broken values.
3535
36 :param dict template_yml: The dict representing the template :term:`.deploy` file
37 :param dict user_yml: The dict representing the user :term:`.deploy` file
36 :param dict template_yml: The dict representing the template :term:`.deploy.yml` file
37 :param dict user_yml: The dict representing the user :term:`.deploy.yml` file
3838 :returns: The user config yaml
3939 :rytpe: Dictionary
4040 :raises FileNotFoundError: if there is either no template file or no user file
7676 # Warn if User is 'root'
7777 elif key == 'User' and user_yml[key] == 'root':
7878 # Not a critical error, simply warn
79 print('Warning: Key: User: "%s" is not security best practice, WWW users '
80 'should be unique...' % user_yml[key])
79 print('Warning: Key: User: "%s" is not security best practice, WWW '
80 'users should be unique...' % user_yml[key])
8181
8282 # # Raise if Path is not accessible
8383 # elif key == 'Path' and not os.access(user_yml[key], os.F_OK):
9898
9999 :param config_path: The path to the config file (defaults to ``.deploy.yml``)
100100 :param str template_path: The path to the template file (defaults to ``TEMPLATE_PATH``
101 in :py:module:`eclecti_deploy`
101 in :class:`eclecti_deploy`)
102102 :type config_path: string or none
103103 :rtype: Dictionary
104104 :raises RuntimeError: when something is wrong with ``config_path``
3737 :type connection: :class:`fabric.Connection`
3838 :param str command: the command to execute on the remote server
3939 :param warn: if true, do not throw exception on non-zero exit status
40 .. warn:: You must check if the command executed yourself with ``result.ok``
4140 :param hide: True if show no data, 'stdout' to only suppress stdout, 'stderr' to only suppress stderr
41
42 .. warning:: You must check if the command executed yourself with ``result.ok``
43
4244 :returns: the result of the command
4345 """
4446 hide = False if verbose else True