mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-09 18:04:02 -07:00
Fix undefined variables, basestring usage, and some associated python3 issues
This commit is contained in:
parent
9f7b0dfc30
commit
225fa5d092
84 changed files with 652 additions and 963 deletions
|
@ -336,8 +336,8 @@ state:
|
|||
}
|
||||
''' # NOQA
|
||||
|
||||
from ansible.module_utils.basic import *
|
||||
from ansible.module_utils.azure_rm_common import *
|
||||
from ansible.module_utils.azure_rm_common import AzureRMModuleBase
|
||||
from ansible.module_utils.six import integer_types
|
||||
|
||||
try:
|
||||
from msrestazure.azure_exceptions import CloudError
|
||||
|
@ -366,7 +366,7 @@ def validate_rule(rule, rule_type=None):
|
|||
priority = rule.get('priority', None)
|
||||
if not priority:
|
||||
raise Exception("Rule priority is required.")
|
||||
if not isinstance(priority, (int, long)):
|
||||
if not isinstance(priority, integer_types):
|
||||
raise Exception("Rule priority attribute must be an integer.")
|
||||
if rule_type != 'default' and (priority < 100 or priority > 4096):
|
||||
raise Exception("Rule priority must be between 100 and 4096")
|
||||
|
@ -716,5 +716,6 @@ class AzureRMSecurityGroup(AzureRMModuleBase):
|
|||
def main():
|
||||
AzureRMSecurityGroup()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue