Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions gpg_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ def _debug(self, msg):

def _execute_task(self):
key_present = False
if self.key_type == 'public':
if self.key_id:
res = self._execute_command('check')
key_present = res['rc'] == 0
elif self.key_type == 'public':
filekey = self._get_key_from_file()
if filekey:
# rerun the original setup with this key in the commands
Expand All @@ -144,9 +147,6 @@ def _execute_task(self):
res = self._execute_command('check-private')
self._debug('checkprivate: %s' % (str(res)))
key_present = res['rc'] == 0
else:
res = self._execute_command('check')
key_present = res['rc'] == 0

if key_present and self.state == 'absent':
res = self._execute_command('delete')
Expand Down