mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge branch 'fix_autorized_keys' of https://github.com/mscherer/ansible into mscherer-fix_autorized_keys
This commit is contained in:
commit
aa0577c211
1 changed files with 5 additions and 2 deletions
|
@ -185,6 +185,9 @@ def parseoptions(options):
|
||||||
if options:
|
if options:
|
||||||
options_list = options.strip().split(",")
|
options_list = options.strip().split(",")
|
||||||
for option in options_list:
|
for option in options_list:
|
||||||
|
# happen when there is comma at the end
|
||||||
|
if option == '':
|
||||||
|
continue
|
||||||
if option.find("=") != -1:
|
if option.find("=") != -1:
|
||||||
(arg,val) = option.split("=", 1)
|
(arg,val) = option.split("=", 1)
|
||||||
else:
|
else:
|
||||||
|
@ -261,9 +264,9 @@ def writekeys(module, filename, keys):
|
||||||
option_str = ""
|
option_str = ""
|
||||||
if options:
|
if options:
|
||||||
option_strings = []
|
option_strings = []
|
||||||
for option_key in options.keys():
|
for option_key in sorted(options.keys()):
|
||||||
if options[option_key]:
|
if options[option_key]:
|
||||||
option_strings.append("%s=%s" % (option_key, options[option_key]))
|
option_strings.append("%s=\"%s\"" % (option_key, options[option_key]))
|
||||||
else:
|
else:
|
||||||
option_strings.append("%s " % option_key)
|
option_strings.append("%s " % option_key)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue