Skip to content

Commit

Permalink
fixing broken check mode in the github_key (#9186)
Browse files Browse the repository at this point in the history
* fixing datetime.strftime()

* added changelog fragment

* Update changelogs/fragments/9186-fix-broken-check-mode-in-github-key.yml

Co-authored-by: Felix Fontein <[email protected]>

---------

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit a863b62)
  • Loading branch information
tomcperry authored and patchback[bot] committed Nov 28, 2024
1 parent f35d238 commit b63c4bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- github_key - in check mode, a faulty call to ```datetime.strftime(...)``` was being made which generated an exception (https://github.com/ansible-collections/community.general/issues/9185).
2 changes: 1 addition & 1 deletion plugins/modules/github_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def create_key(session, name, pubkey, check_mode):
'key': pubkey,
'title': name,
'url': 'http://example.com/CHECK_MODE_GITHUB_KEY',
'created_at': datetime.strftime(now_t, '%Y-%m-%dT%H:%M:%SZ'),
'created_at': datetime.datetime.strftime(now_t, '%Y-%m-%dT%H:%M:%SZ'),
'read_only': False,
'verified': False
}
Expand Down

0 comments on commit b63c4bd

Please sign in to comment.