예제 #1
0
파일: models.py 프로젝트: luccacabra/trove
 def update_all(self, context):
     num_i = len(self.instances)
     LOG.debug("Host %s has %s instances to update" % (self.name, num_i))
     failed_instances = []
     for instance in self.instances:
         client = create_guest_client(context, instance['id'])
         try:
             client.update_guest()
         except exception.TroveError as re:
             LOG.error(re)
             LOG.error("Unable to update instance: %s" % instance['id'])
             failed_instances.append(instance['id'])
     if len(failed_instances) > 0:
         msg = "Failed to update instances: %s" % failed_instances
         raise exception.UpdateGuestError(msg)
예제 #2
0
 def update_all(self, context):
     num_i = len(self.instances)
     LOG.debug("Host %(name)s has %(num)s instances to update.", {
         'name': self.name,
         'num': num_i
     })
     failed_instances = []
     for instance in self.instances:
         client = create_guest_client(context, instance['id'])
         try:
             client.update_guest()
         except exception.TroveError as re:
             LOG.error(re)
             LOG.error(_("Unable to update instance: %s."), instance['id'])
             failed_instances.append(instance['id'])
     if len(failed_instances) > 0:
         msg = _("Failed to update instances: %s.") % failed_instances
         raise exception.UpdateGuestError(msg)