Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
okeanos-LoD
Commits
57c47c00
Unverified
Commit
57c47c00
authored
Jul 06, 2015
by
efikalti
Committed by
Avraam Tsantekidis
Jul 17, 2015
Browse files
LAM-41 changed check_all_resources method
parent
8bd62904
Changes
1
Hide whitespace changes
Inline
Side-by-side
kamaki/provision.py
View file @
57c47c00
...
...
@@ -339,21 +339,43 @@ class Provisioner:
"""
project_id
=
self
.
find_project_id
(
**
kwargs
)[
'id'
]
quotas
=
self
.
get_quotas
()
cluster_size
=
kwargs
.
get
(
"cluster_size"
)
# Check for VMs
if
self
.
check_cluster_size_quotas
(
quotas
,
project_id
,
cluster_size
):
# Check for CPUs
if
self
.
check_cpu_quotas
(
quotas
,
project_id
,
kwargs
.
get
(
"cpu_request"
)):
# Check for RAM
if
self
.
check_ram_quotas
(
quotas
,
project_id
,
kwargs
.
get
(
"ram_request"
)):
# Check for Disk space
if
self
.
check_disk_quotas
(
quotas
,
project_id
,
kwargs
.
get
(
"disk_request"
)):
# Check for public IPs
if
self
.
check_ip_quotas
(
quotas
,
project_id
,
kwargs
.
get
(
"ip_request"
)):
# Check for networks
if
self
.
check_network_quotas
(
quotas
,
project_id
,
kwargs
.
get
(
"network_request"
)):
return
True
return
False
try
:
self
.
check_cluster_size_quotas
(
quotas
,
project_id
,
kwargs
.
get
(
"cluster_size"
))
except
ClientError
as
ex
:
raise
ex
return
False
# Check for CPUs
try
:
self
.
check_cpu_quotas
(
quotas
,
project_id
,
kwargs
.
get
(
"cpu_request"
))
except
ClientError
as
ex
:
raise
ex
return
False
# Check for RAM
try
:
self
.
check_ram_quotas
(
quotas
,
project_id
,
kwargs
.
get
(
"ram_request"
))
except
ClientError
as
ex
:
raise
ex
return
False
# Check for Disk space
try
:
self
.
check_disk_quotas
(
quotas
,
project_id
,
kwargs
.
get
(
"disk_request"
))
except
ClientError
as
ex
:
raise
ex
return
False
# Check for public IPs
try
:
self
.
check_ip_quotas
(
quotas
,
project_id
,
kwargs
.
get
(
"ip_request"
))
except
ClientError
as
ex
:
raise
ex
return
False
# Check for networks
try
:
self
.
check_network_quotas
(
quotas
,
project_id
,
kwargs
.
get
(
"network_request"
))
except
ClientError
as
ex
:
raise
ex
return
False
return
True
if
__name__
==
"__main__"
:
parser
=
argparse
.
ArgumentParser
(
description
=
"Okeanos VM provisioning"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment