fixed syntax errors
parent
9df8799eec
commit
c77ef5d18d
|
@ -344,7 +344,7 @@ def generate_keypair(module, params, matching_keys, check_mode):
|
||||||
'--quick-add-key',
|
'--quick-add-key',
|
||||||
fingerprint,
|
fingerprint,
|
||||||
algo,
|
algo,
|
||||||
' '.join(subkey_usage),
|
' '.join(subkey['subkey_usage']),
|
||||||
params['expire_date'] if params['expire_date'] else ''
|
params['expire_date'] if params['expire_date'] else ''
|
||||||
],
|
],
|
||||||
executable=get_bin_path('gpg')
|
executable=get_bin_path('gpg')
|
||||||
|
@ -422,7 +422,6 @@ def run_module(module, params, check_mode=False):
|
||||||
subkey = re.search(r'.+:([0-9]+):([0-9]+):[0-9A-Z]+:[0-9]+:+([a-z]+):+\+:+([0-9a-zA-Z]+):', line)
|
subkey = re.search(r'.+:([0-9]+):([0-9]+):[0-9A-Z]+:[0-9]+:+([a-z]+):+\+:+([0-9a-zA-Z]+):', line)
|
||||||
subkey_type = key_type_from_algo(int(subkey.group(2)))
|
subkey_type = key_type_from_algo(int(subkey.group(2)))
|
||||||
if params['subkeys'][subkey_count]['type'] and params['subkeys'][subkey_count]['type'] != subkey_type:
|
if params['subkeys'][subkey_count]['type'] and params['subkeys'][subkey_count]['type'] != subkey_type:
|
||||||
|
|
||||||
is_match = False
|
is_match = False
|
||||||
break
|
break
|
||||||
if subkey_type in ['RSA', 'DSA', 'ELG']:
|
if subkey_type in ['RSA', 'DSA', 'ELG']:
|
||||||
|
@ -441,7 +440,7 @@ def run_module(module, params, check_mode=False):
|
||||||
break
|
break
|
||||||
if is_match and uid_present:
|
if is_match and uid_present:
|
||||||
matching_keys.append(fingerprint)
|
matching_keys.append(fingerprint)
|
||||||
|
|
||||||
if params['state'] == 'present':
|
if params['state'] == 'present':
|
||||||
result = generate_keypair(module, params, matching_keys, check_mode)
|
result = generate_keypair(module, params, matching_keys, check_mode)
|
||||||
else:
|
else:
|
||||||
|
@ -483,8 +482,8 @@ def main():
|
||||||
comment=dict(type='str'),
|
comment=dict(type='str'),
|
||||||
email=dict(type='str'),
|
email=dict(type='str'),
|
||||||
passphrase=dict(type='str', no_log=True),
|
passphrase=dict(type='str', no_log=True),
|
||||||
fingerprints=dict(type='list', elements='str', default=[], no_log=True)
|
fingerprints=dict(type='list', elements='str', default=[], no_log=True),
|
||||||
force=dict(type='bool', default=True)
|
force=dict(type='bool', default=False)
|
||||||
),
|
),
|
||||||
supports_check_mode=True,
|
supports_check_mode=True,
|
||||||
required_if=[
|
required_if=[
|
||||||
|
|
Loading…
Reference in New Issue