示例#1
0
 def test_0007(self):
     """Unregister extension"""
     system = System(session=self.vca.vcloud_session, verify=self.vca.verify, log=self.vca.log)
     extension = system.get_extension(config['vcloud']['ext_name'])
     assert extension is not None
     name = extension.attrib['name']
     assert name == config['vcloud']['ext_name']
     result = system.unregister_extension(config['vcloud']['ext_name'], extension.attrib['href'])
     extension = system.get_extension(config['vcloud']['ext_name'])
     assert extension is None
示例#2
0
 def test_0004(self):
     """Get extension"""
     system = System(session=self.vca.vcloud_session, verify=self.vca.verify, log=self.vca.log)
     extension = system.get_extension(config['vcloud']['ext_name'])
     assert extension is not None
     name = extension.attrib['name']
     assert name == config['vcloud']['ext_name']
示例#3
0
 def test_0006(self):
     """Disable extension"""
     system = System(session=self.vca.vcloud_session, verify=self.vca.verify, log=self.vca.log)
     extension = system.get_extension(config['vcloud']['ext_name'])
     assert extension is not None
     name = extension.attrib['name']
     assert name == config['vcloud']['ext_name']
     result = system.enable_extension(name,
                                      extension.attrib['href'],
                                      enabled=False)
     extension = system.get_extension(config['vcloud']['ext_name'])
     assert extension is not None
     name = extension.attrib['name']
     assert name == config['vcloud']['ext_name']
     enabled = '****'
     for node in extension.findall('.//{http://www.vmware.com/vcloud/extension/v1.5}Enabled'):
         enabled = node.text
     assert enabled == 'false'
示例#4
0
password = os.environ['PASSWORD']
org = 'System'
org_url = 'https://%s/cloud' % host
verify = False
log = True
version = '27.0'
extension_name = sys.argv[1]

vca = VCA(host=host,
          username=username,
          service_type='standalone',
          version=version,
          verify=verify,
          log=log)

result = vca.login(password=password, org=org, org_url=org_url)
print_vca(vca)

system = System(session=vca.vcloud_session, verify=verify, log=log)

patterns = ['/cluster', '/cluster/.*', '/cluster/.*/.*']
result = system.register_extension(extension_name, extension_name,
                                   extension_name, patterns)
print(result)

extension = system.get_extension(extension_name)
if extension == None:
    print(('extension %s not found' % extension_name))
else:
    print((extension.attrib['name']))
示例#5
0
        else:
            print('vca vcloud session:   ', vca.vcloud_session)
    else:
        print('vca: ', vca)


host = 'vcd.cpsbu.eng.vmware.com'
username = '******'
password = os.environ['PASSWORD']
org = 'System'
org_url = 'https://%s/cloud' % host
verify = False
log = True
version = '27.0'

vca = VCA(host=host,
          username=username,
          service_type='standalone',
          version=version,
          verify=verify,
          log=log)

result = vca.login(password=password, org=org, org_url=org_url)
print_vca(vca)

system = System(session=vca.vcloud_session, verify=verify, log=log)

print('extension found:')
extension = system.get_extension(sys.argv[1])
print((extension.__dict__))