Esempio n. 1
0
 def __get__token(self):
     """
     get token
     :return: token
     """
     return http.get_token(self.keystone_url + '/tokens', self.tenant,
                           self.user, self.password)
Esempio n. 2
0
 def __init__(self, keystone_url, paas_manager_url, tenant, user, password, vdc, sdc_url, VM_IP, VM_hostname):
     """
     constructor
     :type sdc_url: object
     :type paas_manager_url:
     :param keystone_url:
     :param paas_manager_url:
     :param tenant:
     :param user:
     :param password:
     :param vdc:
     :param sdc_url:
     """
     self.paasmanager_url = paas_manager_url
     self.sdc_url = sdc_url
     self.vdc = vdc
     self.keystone_url = keystone_url
     self.user = user
     self.password = password
     self.tenant = tenant
     world.VM_IP = VM_IP
     world.VM_hostname = VM_hostname
     self.token=http.get_token(self.keystone_url + '/tokens', self.tenant, self.user, self.password)
Esempio n. 3
0
 def __get__token(self):
     """ Get token from keystone """
     return http.get_token(self.keystone_url + '/tokens', self.tenant, self.user, self.password)
Esempio n. 4
0
 def __get__token(self):
     return http.get_token(self.keystone_url + '/tokens', self.tenant, self.user, self.password)
Esempio n. 5
0
    if ((parts[len(parts) - 1]) == 'rb'):
        print "***ERROR***"
        print "Recipe extension should NOT be added: .rb"
        print "Usage: openstack.py <node_name> <so> <cookbook> <recipe> <deleteVM [yes][no]>"
        print "Example: python openstack.py bmm06 centos orion 0.8.1_install no"
        print "***********"
        sys.exit(1)

    node = sys.argv[1]
    os = sys.argv[2]
    if (sys.argv[4] == ''):
        softwareInstall = sys.argv[3]
    else:
        softwareInstall = sys.argv[3] + '::' + sys.argv[4]
    print node
    token = http.get_token('http://130.206.80.63:35357/v2.0/tokens', 'admin',
                           'admin', 'openstack')
    print token
    g = OpenstackRequest(token)
    ip = g.deploy_vm(node, os)
    print ip
    time.sleep(60)
    mynode = g.install_software_in_node(node, softwareInstall)
    g.connect_ssh(ip, os)

    if (sys.argv[5] == 'yes'):
        #       g.remove_node(mynode)
        g.delete_vm()

    print '**********'
    print '   END    '
    print '**********'
Esempio n. 6
0
 def __get__token(self):
     self.token = http.get_token(self.keystone_url + '/tokens', self.tenant,
                                 self.user, self.password)
Esempio n. 7
0
 def __get__token(self):
     return http.get_token("http://" + self.keystone_url + '/tokens',
                           self.tenant, self.user, self.password)
Esempio n. 8
0
    if ((parts[len(parts) - 1]) == 'rb'):
        print "***ERROR***"
        print "Recipe extension should NOT be added: .rb"
        print "Usage: openstack.py <node_name> <so> <cookbook> <recipe> <deleteVM [yes][no]>"
        print "Example: python openstack.py bmm06 centos orion 0.8.1_install no"
        print "***********"
        sys.exit(1)

    node = sys.argv[1]
    os = sys.argv[2]
    if ( sys.argv[4] == ''):
        softwareInstall = sys.argv[3]
    else:
        softwareInstall = sys.argv[3] + '::' + sys.argv[4]
    print node
    token = http.get_token('http://130.206.80.63:35357/v2.0/tokens', 'admin', 'admin', 'openstack')
    print token
    g = OpenstackRequest(token)
    ip = g.deploy_vm(node, os)
    print ip
    time.sleep(60)
    mynode = g.install_software_in_node(node, softwareInstall)
    g.connect_ssh(ip, os)

    if (sys.argv[5] == 'yes'):
    #       g.remove_node(mynode)
        g.delete_vm()

    print '**********'
    print '   END    '
    print '**********'