Пример #1
0
    def secure_all_hosts(self):
        for host in self.hosts:
            cmd = provisionCertificate.provisionCertificateCmd()
            cmd.hostid = host.id
            cmd.reconnect = True
            self.apiclient.provisionCertificate(cmd)

        for host in self.hosts:
            self.check_connection(secured='true', host=host)
Пример #2
0
    def secure_all_hosts(self):
        for host in self.hosts:
            cmd = provisionCertificate.provisionCertificateCmd()
            cmd.hostid = host.id
            cmd.reconnect = True
            self.apiclient.updateConfiguration(cmd)

        for host in self.hosts:
            self.check_connection(secured='true', host=host)
Пример #3
0
    def make_all_hosts_secure(self):
        hosts = Host.list(self.apiclient, zoneid=self.zone.id, type='Routing')
        for host in hosts:
            cmd = provisionCertificate.provisionCertificateCmd()
            cmd.hostid = host.id
            self.apiclient.updateConfiguration(cmd)

        for host in hosts:
            self.check_connection(secured='true', host=host)
Пример #4
0
    def secure_all_hosts(self):
        for host in self.hosts:
            cmd = provisionCertificate.provisionCertificateCmd()
            cmd.hostid = host.id
            cmd.reconnect = True
            self.apiclient.provisionCertificate(cmd)

        for host in self.hosts:
            print("Securing Host %s" % host.name)
            self.waitUntilHostInState(hostId=host.id, state="Up")
            self.check_connection(secured='true', host=host)
Пример #5
0
 def secure_host(self, host):
     print("host %s secured parameter is: %s and should be 'true'" %
           (host.name, host.details.secured))
     if "true" in host.details.secured:
         print("Host %s already secure, continuing" % (host.name))
         return host
     else:
         print("Securing Host %s" % host.name)
         cmd = provisionCertificate.provisionCertificateCmd()
         cmd.hostid = host.id
         cmd.reconnect = True
         self.apiclient.provisionCertificate(cmd)
         print(
             "Allowing quiet time to allow CloudStack to see host %s state"
             % host.name)
         time.sleep(30)
         self.waitUntilHostInState(hostId=host.id, state="Up")
         self.check_connection(secured='true', host=host)
         return host