Use python docstring.
Use the python docstring format for the documentation of the function. Add the documentation for the parameter and raise error. Remove the unless variable. Change-Id: I83353eaa6f927b62b9840daeb2b8c0a1c836acfa
This commit is contained in:
parent
5a66fe5446
commit
f2e403a16b
|
@ -1892,16 +1892,22 @@ def ansible_symlink():
|
||||||
|
|
||||||
|
|
||||||
def check_file_for_enabled_service(env_file):
|
def check_file_for_enabled_service(env_file):
|
||||||
# This function checks environment file for the said service.
|
"""Checks environment file for the said service.
|
||||||
# If stack to be deployed/updated/upgraded has any deprecated service
|
|
||||||
# enabled, throw a warning about its deprecation and ask the user
|
|
||||||
# whether to proceed with deployment despite deprecation.
|
|
||||||
# For ODL as an example:
|
|
||||||
# If "OS::TripleO::Services::OpenDaylightApi" service is included
|
|
||||||
# in any of the parsed env_files, then check its value.
|
|
||||||
# OS::TripleO::Services::OpenDaylightApi NOT OS::Heat::None
|
|
||||||
# ODL is enabled.
|
|
||||||
|
|
||||||
|
If stack to be to be deployed/updated/upgraded has any deprecated service
|
||||||
|
enabled, throw a warning about its deprecation and ask the user
|
||||||
|
whether to proceed with deployment despite deprecation.
|
||||||
|
For ODL as an example:
|
||||||
|
If "OS::TripleO::Services::OpenDaylightApi" service is included
|
||||||
|
in any of the parsed env_files, then check its value.
|
||||||
|
OS::TripleO::Services::OpenDaylightApi NOT OS::Heat::None
|
||||||
|
ODL is enabled.
|
||||||
|
|
||||||
|
:param env_file: The path of the environment file
|
||||||
|
:type env_file: String
|
||||||
|
|
||||||
|
:raises CommandError: If the action is not confirmed
|
||||||
|
"""
|
||||||
if os.path.exists(env_file):
|
if os.path.exists(env_file):
|
||||||
with open(env_file, "r") as f:
|
with open(env_file, "r") as f:
|
||||||
content = yaml.load(f)
|
content = yaml.load(f)
|
||||||
|
@ -1913,7 +1919,7 @@ def check_file_for_enabled_service(env_file):
|
||||||
+ str(env_file) + ". " +
|
+ str(env_file) + ". " +
|
||||||
constants.DEPRECATED_SERVICES[service])
|
constants.DEPRECATED_SERVICES[service])
|
||||||
deprecated_services_enabled.append(service)
|
deprecated_services_enabled.append(service)
|
||||||
except (KeyError, TypeError) as e:
|
except (KeyError, TypeError):
|
||||||
# ignore if content["resource_registry"] is empty
|
# ignore if content["resource_registry"] is empty
|
||||||
pass
|
pass
|
||||||
if deprecated_services_enabled:
|
if deprecated_services_enabled:
|
||||||
|
|
Loading…
Reference in New Issue