mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
parent
8de4f7cd9f
commit
3680d65d1d
1 changed files with 16 additions and 11 deletions
|
@ -73,6 +73,8 @@ class ConfigCLI(CLI):
|
||||||
else:
|
else:
|
||||||
self.config = ConfigManager()
|
self.config = ConfigManager()
|
||||||
self.config_file = find_ini_config_file()
|
self.config_file = find_ini_config_file()
|
||||||
|
|
||||||
|
if self.config_file:
|
||||||
try:
|
try:
|
||||||
if not os.path.exists(self.config_file):
|
if not os.path.exists(self.config_file):
|
||||||
raise AnsibleOptionsError("%s does not exist or is not accessible" % (self.config_file))
|
raise AnsibleOptionsError("%s does not exist or is not accessible" % (self.config_file))
|
||||||
|
@ -86,6 +88,9 @@ class ConfigCLI(CLI):
|
||||||
elif self.action in ['edit', 'update']:
|
elif self.action in ['edit', 'update']:
|
||||||
display.warning("File does not exist, used empty file: %s" % self.config_file)
|
display.warning("File does not exist, used empty file: %s" % self.config_file)
|
||||||
|
|
||||||
|
elif self.action == 'view':
|
||||||
|
raise AnsibleError('Invalid or no config file was supplied')
|
||||||
|
|
||||||
self.execute()
|
self.execute()
|
||||||
|
|
||||||
def execute_update(self):
|
def execute_update(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue