Browse Source

source fixes, better default values

pull/3/head
Sebastian Rieger 7 years ago
parent
commit
cd24f275f7
  1. 16
      demo2-instance-with-init-script.py
  2. 15
      demo3-microservice.py
  3. 20
      demo4-scale-out-destroy.py
  4. 19
      demo4-scale-out.py

16
demo2-instance-with-init-script.py

@ -1,6 +1,6 @@
import getpass
# import getpass
# import os
import os
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
@ -22,7 +22,7 @@ ubuntu_image_name = "Ubuntu 14.04 - Trusty Tahr - 64-bit - Cloud Based Image"
flavor_name = 'm1.small' flavor_name = 'm1.small'
network_name = "ai-netlab-pro-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'
@ -35,11 +35,11 @@ def main():
# #
########################################################################### ###########################################################################
if "OS_PASSWORD" in os.environ:
auth_password = os.environ["OS_PASSWORD"]
else:
auth_password = getpass.getpass("Enter your OpenStack password:")
# auth_password = "demo"
# if "OS_PASSWORD" in os.environ:
# auth_password = os.environ["OS_PASSWORD"]
# else:
# auth_password = getpass.getpass("Enter your OpenStack password:")
auth_password = "demo"
########################################################################### ###########################################################################
# #

15
demo3-microservice.py

@ -1,5 +1,5 @@
import getpass
import os
# import getpass
# import os
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
@ -26,7 +26,7 @@ ubuntu_image_name = "Ubuntu 14.04 - Trusty Tahr - 64-bit - Cloud Based Image"
flavor_name = 'm1.small' flavor_name = 'm1.small'
network_name = "ai-netlab-pro-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'
@ -39,10 +39,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"
########################################################################### ###########################################################################
# #

20
demo4-scale-out-destroy.py

@ -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()

19
demo4-scale-out.py

@ -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,

Loading…
Cancel
Save