mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
cloudstack: replace old _id() with new generic style from utils
This commit is contained in:
parent
9ff63f2338
commit
e03827b490
4 changed files with 13 additions and 13 deletions
|
@ -536,7 +536,7 @@ class AnsibleCloudStackInstance(AnsibleCloudStack):
|
||||||
args_instance_update['group'] = self.module.params.get('group')
|
args_instance_update['group'] = self.module.params.get('group')
|
||||||
args_instance_update['displayname'] = self.get_display_name()
|
args_instance_update['displayname'] = self.get_display_name()
|
||||||
args_instance_update['userdata'] = self.get_user_data()
|
args_instance_update['userdata'] = self.get_user_data()
|
||||||
args_instance_update['ostypeid'] = self.get_os_type_id()
|
args_instance_update['ostypeid'] = self.get_os_type('id')
|
||||||
|
|
||||||
args_ssh_key = {}
|
args_ssh_key = {}
|
||||||
args_ssh_key['id'] = instance['id']
|
args_ssh_key['id'] = instance['id']
|
||||||
|
|
|
@ -189,11 +189,11 @@ class AnsibleCloudStackIso(AnsibleCloudStack):
|
||||||
iso = self.get_iso()
|
iso = self.get_iso()
|
||||||
if not iso:
|
if not iso:
|
||||||
args = {}
|
args = {}
|
||||||
args['zoneid'] = self.get_zone_id()
|
args['zoneid'] = self.get_zone('id')
|
||||||
args['projectid'] = self.get_project_id()
|
args['projectid'] = self.get_project('id')
|
||||||
|
|
||||||
args['bootable'] = self.module.params.get('bootable')
|
args['bootable'] = self.module.params.get('bootable')
|
||||||
args['ostypeid'] = self.get_os_type_id()
|
args['ostypeid'] = self.get_os_type('id')
|
||||||
if args['bootable'] and not args['ostypeid']:
|
if args['bootable'] and not args['ostypeid']:
|
||||||
self.module.fail_json(msg="OS type 'os_type' is requried if 'bootable=true'.")
|
self.module.fail_json(msg="OS type 'os_type' is requried if 'bootable=true'.")
|
||||||
|
|
||||||
|
@ -220,8 +220,8 @@ class AnsibleCloudStackIso(AnsibleCloudStack):
|
||||||
args = {}
|
args = {}
|
||||||
args['isready'] = self.module.params.get('is_ready')
|
args['isready'] = self.module.params.get('is_ready')
|
||||||
args['isofilter'] = self.module.params.get('iso_filter')
|
args['isofilter'] = self.module.params.get('iso_filter')
|
||||||
args['projectid'] = self.get_project_id()
|
args['projectid'] = self.get_project('id')
|
||||||
args['zoneid'] = self.get_zone_id()
|
args['zoneid'] = self.get_zone('id')
|
||||||
|
|
||||||
# if checksum is set, we only look on that.
|
# if checksum is set, we only look on that.
|
||||||
checksum = self.module.params.get('checksum')
|
checksum = self.module.params.get('checksum')
|
||||||
|
@ -246,8 +246,8 @@ class AnsibleCloudStackIso(AnsibleCloudStack):
|
||||||
self.result['changed'] = True
|
self.result['changed'] = True
|
||||||
args = {}
|
args = {}
|
||||||
args['id'] = iso['id']
|
args['id'] = iso['id']
|
||||||
args['projectid'] = self.get_project_id()
|
args['projectid'] = self.get_project('id')
|
||||||
args['zoneid'] = self.get_zone_id()
|
args['zoneid'] = self.get_zone('id')
|
||||||
if not self.module.check_mode:
|
if not self.module.check_mode:
|
||||||
res = self.cs.deleteIso(**args)
|
res = self.cs.deleteIso(**args)
|
||||||
return iso
|
return iso
|
||||||
|
|
|
@ -98,7 +98,7 @@ class AnsibleCloudStackSecurityGroup(AnsibleCloudStack):
|
||||||
if not self.security_group:
|
if not self.security_group:
|
||||||
sg_name = self.module.params.get('name')
|
sg_name = self.module.params.get('name')
|
||||||
args = {}
|
args = {}
|
||||||
args['projectid'] = self.get_project_id()
|
args['projectid'] = self.get_project('id')
|
||||||
sgs = self.cs.listSecurityGroups(**args)
|
sgs = self.cs.listSecurityGroups(**args)
|
||||||
if sgs:
|
if sgs:
|
||||||
for s in sgs['securitygroup']:
|
for s in sgs['securitygroup']:
|
||||||
|
@ -115,7 +115,7 @@ class AnsibleCloudStackSecurityGroup(AnsibleCloudStack):
|
||||||
|
|
||||||
args = {}
|
args = {}
|
||||||
args['name'] = self.module.params.get('name')
|
args['name'] = self.module.params.get('name')
|
||||||
args['projectid'] = self.get_project_id()
|
args['projectid'] = self.get_project('id')
|
||||||
args['description'] = self.module.params.get('description')
|
args['description'] = self.module.params.get('description')
|
||||||
|
|
||||||
if not self.module.check_mode:
|
if not self.module.check_mode:
|
||||||
|
@ -134,7 +134,7 @@ class AnsibleCloudStackSecurityGroup(AnsibleCloudStack):
|
||||||
|
|
||||||
args = {}
|
args = {}
|
||||||
args['name'] = self.module.params.get('name')
|
args['name'] = self.module.params.get('name')
|
||||||
args['projectid'] = self.get_project_id()
|
args['projectid'] = self.get_project('id')
|
||||||
|
|
||||||
if not self.module.check_mode:
|
if not self.module.check_mode:
|
||||||
res = self.cs.deleteSecurityGroup(**args)
|
res = self.cs.deleteSecurityGroup(**args)
|
||||||
|
|
|
@ -267,7 +267,7 @@ class AnsibleCloudStackSecurityGroupRule(AnsibleCloudStack):
|
||||||
security_group_name = self.module.params.get('security_group')
|
security_group_name = self.module.params.get('security_group')
|
||||||
args = {}
|
args = {}
|
||||||
args['securitygroupname'] = security_group_name
|
args['securitygroupname'] = security_group_name
|
||||||
args['projectid'] = self.get_project_id()
|
args['projectid'] = self.get_project('id')
|
||||||
sgs = self.cs.listSecurityGroups(**args)
|
sgs = self.cs.listSecurityGroups(**args)
|
||||||
if not sgs or 'securitygroup' not in sgs:
|
if not sgs or 'securitygroup' not in sgs:
|
||||||
self.module.fail_json(msg="security group '%s' not found" % security_group_name)
|
self.module.fail_json(msg="security group '%s' not found" % security_group_name)
|
||||||
|
@ -297,7 +297,7 @@ class AnsibleCloudStackSecurityGroupRule(AnsibleCloudStack):
|
||||||
args['endport'] = self.get_end_port()
|
args['endport'] = self.get_end_port()
|
||||||
args['icmptype'] = self.module.params.get('icmp_type')
|
args['icmptype'] = self.module.params.get('icmp_type')
|
||||||
args['icmpcode'] = self.module.params.get('icmp_code')
|
args['icmpcode'] = self.module.params.get('icmp_code')
|
||||||
args['projectid'] = self.get_project_id()
|
args['projectid'] = self.get_project('id')
|
||||||
args['securitygroupid'] = security_group['id']
|
args['securitygroupid'] = security_group['id']
|
||||||
|
|
||||||
rule = None
|
rule = None
|
||||||
|
|
Loading…
Reference in a new issue