-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azure_rm_sqldatabase: parse datetime module arguments #623
Conversation
tests/sanity/ignore-2.10.txt:273:1: A100: Ignoring 'invalid-ansiblemodule-schema' on 'plugins/modules/azure_rm_sqldatabase.py' is unnecessary |
Removed, thanks! |
Same operation (tests/sanity/ignore-2.11.txt and tests/sanity/ignore-2.12.txt) |
This comment has been minimized.
This comment has been minimized.
@@ -224,6 +224,7 @@ | |||
|
|||
import time | |||
from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, format_resource_id | |||
import dateutil.parser |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import dateutil.parser |
@nbr23 Can you add test cases for newly added logic? Thank you very much! |
LGTM |
* azure_rm_sqldatabase: parse datetime module arguments (ansible-collections#623) * rm_sqldatabase: parse datetime arguments * Remove unused sanity test exception on rm_sqldatabase module schema * Remove unused sanity test exception on rm_sqldatabase module schema bis * sqldatabase: import dateutil in try/except * Add dateutil install to test suite * sqldatabase_info: Add earliest_restore_date value to returned facts * sqldatabase: add point in time restore test * Conditionally call non MSI auth when interacting with keyvault (ansible-collections#770) * Added the VM status detection mechanism (ansible-collections#772) * Set the parameter to a random number * Update storage account name Update azure_rm_virtualmachine vars add new change add new change 02 add new change 03 add new change 05 add new change 06 add new change 08 add new change09 update new Update new 02 Improve code logic * fix a typo error. related to ansible-collections#757 (ansible-collections#769) * fix a typo error. related to ansible-collections#757 * remove unused line Co-authored-by: Daniele Marcocci <[email protected]> * Update test region (ansible-collections#776) Co-authored-by: Max <[email protected]> Co-authored-by: Daniele Marcocci <[email protected]> Co-authored-by: Daniele Marcocci <[email protected]>
* Ugrade azure-mgmt-compute SDK to track2 * fix small * Modify version from v2021-07-01 to v2020-04-01, no disk encryptions operation * Update small * fix azure_rm_diskencryption test fail * fix azure_rm_diskencryption test fail02 * fix sanity error * fix azure_rm_diskcryptionset test fail * fix azure_rm_virtualmachinescalesetinstance_info bug * fix azure_rm_virtualmachinescalesetinstance_info bug 02 * fix azure_rm_virtualmachien*extension test fail * Update azure_rm_virtualmachinescalesetinstance func paramter to vm_instance_i_ds * fix azure_rm_virtualmachinescalesetinstance test fail * fix sanity test fail * change exception type * fix azure_rm_hostgroup module * Update the code that throws the exception * Merge dev to local branch (#10) * azure_rm_sqldatabase: parse datetime module arguments (#623) * rm_sqldatabase: parse datetime arguments * Remove unused sanity test exception on rm_sqldatabase module schema * Remove unused sanity test exception on rm_sqldatabase module schema bis * sqldatabase: import dateutil in try/except * Add dateutil install to test suite * sqldatabase_info: Add earliest_restore_date value to returned facts * sqldatabase: add point in time restore test * Conditionally call non MSI auth when interacting with keyvault (#770) * Added the VM status detection mechanism (#772) * Set the parameter to a random number * Update storage account name Update azure_rm_virtualmachine vars add new change add new change 02 add new change 03 add new change 05 add new change 06 add new change 08 add new change09 update new Update new 02 Improve code logic * fix a typo error. related to #757 (#769) * fix a typo error. related to #757 * remove unused line Co-authored-by: Daniele Marcocci <[email protected]> * Update test region (#776) Co-authored-by: Max <[email protected]> Co-authored-by: Daniele Marcocci <[email protected]> Co-authored-by: Daniele Marcocci <[email protected]> * Revert "Merge dev to local branch (#10)" (#11) This reverts commit 1dce8f3. Co-authored-by: Max <[email protected]> Co-authored-by: Daniele Marcocci <[email protected]> Co-authored-by: Daniele Marcocci <[email protected]>
SUMMARY
In
azure_rm_sqldatabase
, the argumentsrestore_point_in_time
andsource_database_deletion_date
are dates.This bugfix parses the string passed as argument, and creates the datetime object required.
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
Currently the module expects
datetime
objtects to be passed directly as module arguments from the playbook. However, it appears thatargument_spec
does not handledatetime
as an input type: https://docs.ansible.com/ansible/latest/dev_guide/developing_program_flow_modules.html#argument-specTo correct this, this fix changed the type of
restore_point_in_time
andsource_database_deletion_date
tostr
, and calls dateutil.parse on the string to get the datetime object expected by the azure sdk.This fixes #619