예제 #1
0
파일: meta.py 프로젝트: cdosborn/rtwo
 def destroy_all_instances(self):
     """
     Destroy all instances and delete tenant networks for all users.
     """
     for instance in self.all_instances():
         self.admin_driver.destroy_instance(instance)
         logger.debug('Destroyed instance %s' % instance)
     os_driver = OSAccountDriver()
     for username in os_driver.list_usergroup_names():
         tenant_name = username
         os_driver.network_manager.delete_tenant_network(username,
                                                         tenant_name)
     return True
예제 #2
0
 def destroy_all_instances(self):
     """
     Destroy all instances and delete tenant networks for all users.
     """
     for instance in self.all_instances():
         self.admin_driver.destroy_instance(instance)
         logger.debug('Destroyed instance %s' % instance)
     os_driver = OSAccountDriver()
     for username in os_driver.list_usergroup_names():
         tenant_name = username
         os_driver.network_manager.delete_tenant_network(
             username, tenant_name)
     return True
예제 #3
0
파일: meta.py 프로젝트: cdosborn/rtwo
    def stop_all_instances(self, destroy=False):
        """
        Stop all instances and delete tenant networks for all users.

        To destroy instances instead of stopping them use the destroy
        keyword (destroy=True).
        """
        for instance in self.all_instances():
            if destroy:
                self.admin_driver.destroy_instance(instance)
                logger.debug('Destroyed instance %s' % instance)
            else:
                if instance.get_status() == 'active':
                    self.admin_driver.stop_instance(instance)
                    logger.debug('Stopped instance %s' % instance)
        os_driver = OSAccountDriver()
        if destroy:
            for username in os_driver.list_usergroup_names():
                tenant_name = username
                os_driver.network_manager.delete_tenant_network(username,
                                                                tenant_name)
        return True
예제 #4
0
    def stop_all_instances(self, destroy=False):
        """
        Stop all instances and delete tenant networks for all users.

        To destroy instances instead of stopping them use the destroy
        keyword (destroy=True).
        """
        for instance in self.all_instances():
            if destroy:
                self.admin_driver.destroy_instance(instance)
                logger.debug('Destroyed instance %s' % instance)
            else:
                if instance.get_status() == 'active':
                    self.admin_driver.stop_instance(instance)
                    logger.debug('Stopped instance %s' % instance)
        os_driver = OSAccountDriver()
        if destroy:
            for username in os_driver.list_usergroup_names():
                tenant_name = username
                os_driver.network_manager.delete_tenant_network(
                    username, tenant_name)
        return True