cloudstack: replace old _id() with new generic style from utils

This commit is contained in:
Rene Moser 2015-05-14 00:18:10 +02:00
parent 7705d1bb50
commit 2b7a40a46a
4 changed files with 13 additions and 13 deletions

View file

@ -536,7 +536,7 @@ class AnsibleCloudStackInstance(AnsibleCloudStack):
args_instance_update['group'] = self.module.params.get('group')
args_instance_update['displayname'] = self.get_display_name()
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['id'] = instance['id']

View file

@ -190,11 +190,11 @@ class AnsibleCloudStackIso(AnsibleCloudStack):
iso = self.get_iso()
if not iso:
args = {}
args['zoneid'] = self.get_zone_id()
args['projectid'] = self.get_project_id()
args['zoneid'] = self.get_zone('id')
args['projectid'] = self.get_project('id')
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']:
self.module.fail_json(msg="OS type 'os_type' is requried if 'bootable=true'.")
@ -221,8 +221,8 @@ class AnsibleCloudStackIso(AnsibleCloudStack):
args = {}
args['isready'] = self.module.params.get('is_ready')
args['isofilter'] = self.module.params.get('iso_filter')
args['projectid'] = self.get_project_id()
args['zoneid'] = self.get_zone_id()
args['projectid'] = self.get_project('id')
args['zoneid'] = self.get_zone('id')
# if checksum is set, we only look on that.
checksum = self.module.params.get('checksum')
@ -247,8 +247,8 @@ class AnsibleCloudStackIso(AnsibleCloudStack):
self.result['changed'] = True
args = {}
args['id'] = iso['id']
args['projectid'] = self.get_project_id()
args['zoneid'] = self.get_zone_id()
args['projectid'] = self.get_project('id')
args['zoneid'] = self.get_zone('id')
if not self.module.check_mode:
res = self.cs.deleteIso(**args)
return iso

View file

@ -100,7 +100,7 @@ class AnsibleCloudStackSecurityGroup(AnsibleCloudStack):
if not self.security_group:
sg_name = self.module.params.get('name')
args = {}
args['projectid'] = self.get_project_id()
args['projectid'] = self.get_project('id')
sgs = self.cs.listSecurityGroups(**args)
if sgs:
for s in sgs['securitygroup']:
@ -117,7 +117,7 @@ class AnsibleCloudStackSecurityGroup(AnsibleCloudStack):
args = {}
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')
if not self.module.check_mode:
@ -136,7 +136,7 @@ class AnsibleCloudStackSecurityGroup(AnsibleCloudStack):
args = {}
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:
res = self.cs.deleteSecurityGroup(**args)

View file

@ -268,7 +268,7 @@ class AnsibleCloudStackSecurityGroupRule(AnsibleCloudStack):
security_group_name = self.module.params.get('security_group')
args = {}
args['securitygroupname'] = security_group_name
args['projectid'] = self.get_project_id()
args['projectid'] = self.get_project('id')
sgs = self.cs.listSecurityGroups(**args)
if not sgs or 'securitygroup' not in sgs:
self.module.fail_json(msg="security group '%s' not found" % security_group_name)
@ -298,7 +298,7 @@ class AnsibleCloudStackSecurityGroupRule(AnsibleCloudStack):
args['endport'] = self.get_end_port()
args['icmptype'] = self.module.params.get('icmp_type')
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']
rule = None