Commit 0427f773 authored by efikalti's avatar efikalti
Browse files

added check for allow_create in flavor

parent 77f89bc1
...@@ -138,6 +138,7 @@ class Provisioner: ...@@ -138,6 +138,7 @@ class Provisioner:
ip_request=kwargs['ip_request'], ip_request=kwargs['ip_request'],
network_request=kwargs['network_request'], network_request=kwargs['network_request'],
project_name=kwargs['project_name']) project_name=kwargs['project_name'])
if response: if response:
# Get ssh keys # Get ssh keys
key = RSA.generate(2048) key = RSA.generate(2048)
...@@ -483,8 +484,12 @@ class Provisioner: ...@@ -483,8 +484,12 @@ class Provisioner:
""" """
project_id = self.find_project_id(**kwargs)['id'] project_id = self.find_project_id(**kwargs)['id']
flavor = self.find_flavor(**kwargs) flavor = self.find_flavor(**kwargs)
print(flavor)
#check flavor
if flavor['SNF'] != 'allow_create':
msg = 'This flavor does not allow create.'
raise ClientError(msg, error_flavor_list)
return False
# Check for VMs # Check for VMs
pending_vm = quotas[project_id]['cyclades.vm']['project_pending'] pending_vm = quotas[project_id]['cyclades.vm']['project_pending']
limit_vm = quotas[project_id]['cyclades.vm']['project_limit'] limit_vm = quotas[project_id]['cyclades.vm']['project_limit']
...@@ -569,7 +574,7 @@ if __name__ == "__main__": ...@@ -569,7 +574,7 @@ if __name__ == "__main__":
args = parser.parse_args() args = parser.parse_args()
provisioner = Provisioner(cloud_name=args.cloud) provisioner = Provisioner(cloud_name=args.cloud)
"""
response = provisioner.create_lambda_cluster(vm_name="lambda-master" , slaves=args.slaves, response = provisioner.create_lambda_cluster(vm_name="lambda-master" , slaves=args.slaves,
...@@ -583,8 +588,8 @@ if __name__ == "__main__": ...@@ -583,8 +588,8 @@ if __name__ == "__main__":
ip_request=args.ip_request, ip_request=args.ip_request,
network_request=args.network_request, network_request=args.network_request,
project_name=args.project_name) project_name=args.project_name)
print(provisioner.get_cluster_details()) #print(provisioner.get_cluster_details())
"""
#details = {'nodes':[668403,668404],'vpn':144076} #details = {'nodes':[668403,668404],'vpn':144076}
#provisioner.delete_lambda_cluster(details) #provisioner.delete_lambda_cluster(details)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment