|
@ -1,7 +1,7 @@ |
|
|
import getpass |
|
|
|
|
|
import os |
|
|
|
|
|
|
|
|
# import getpass |
|
|
|
|
|
# import os |
|
|
|
|
|
# import libcloud.security |
|
|
|
|
|
|
|
|
#import libcloud.security |
|
|
|
|
|
import time |
|
|
import time |
|
|
from libcloud.compute.providers import get_driver |
|
|
from libcloud.compute.providers import get_driver |
|
|
from libcloud.compute.types import Provider |
|
|
from libcloud.compute.types import Provider |
|
@ -28,7 +28,7 @@ ubuntu_image_name = "Ubuntu 14.04 - Trusty Tahr - 64-bit - Cloud Based Image" |
|
|
|
|
|
|
|
|
flavor_name = 'm1.small' |
|
|
flavor_name = 'm1.small' |
|
|
|
|
|
|
|
|
network_name = "CloudCompX-net" |
|
|
|
|
|
|
|
|
network_name = "CloudCompGrpX-net" |
|
|
|
|
|
|
|
|
keypair_name = 'srieger-pub' |
|
|
keypair_name = 'srieger-pub' |
|
|
pub_key_file = '~/.ssh/id_rsa.pub' |
|
|
pub_key_file = '~/.ssh/id_rsa.pub' |
|
@ -41,10 +41,11 @@ def main(): |
|
|
# |
|
|
# |
|
|
########################################################################### |
|
|
########################################################################### |
|
|
|
|
|
|
|
|
if "OS_PASSWORD" in os.environ: |
|
|
|
|
|
auth_password = os.environ["OS_PASSWORD"] |
|
|
|
|
|
else: |
|
|
|
|
|
auth_password = getpass.getpass("Enter your OpenStack password:") |
|
|
|
|
|
|
|
|
# if "OS_PASSWORD" in os.environ: |
|
|
|
|
|
# auth_password = os.environ["OS_PASSWORD"] |
|
|
|
|
|
# else: |
|
|
|
|
|
# auth_password = getpass.getpass("Enter your OpenStack password:") |
|
|
|
|
|
auth_password = "demo" |
|
|
|
|
|
|
|
|
########################################################################### |
|
|
########################################################################### |
|
|
# |
|
|
# |
|
@ -52,7 +53,7 @@ def main(): |
|
|
# |
|
|
# |
|
|
########################################################################### |
|
|
########################################################################### |
|
|
|
|
|
|
|
|
#libcloud.security.VERIFY_SSL_CERT = False |
|
|
|
|
|
|
|
|
# libcloud.security.VERIFY_SSL_CERT = False |
|
|
|
|
|
|
|
|
provider = get_driver(Provider.OPENSTACK) |
|
|
provider = get_driver(Provider.OPENSTACK) |
|
|
conn = provider(auth_username, |
|
|
conn = provider(auth_username, |
|
@ -94,5 +95,6 @@ def main(): |
|
|
print('Deleting security group: %s' % group.name) |
|
|
print('Deleting security group: %s' % group.name) |
|
|
conn.ex_delete_security_group(group) |
|
|
conn.ex_delete_security_group(group) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
if __name__ == '__main__': |
|
|
main() |
|
|
main() |