Exemplo n.º 1
0
 def handle(self, request, data):
     try:
         api.environment_update(request,
                                data['environment_id'],
                                data['name'])
     except Exception:
         exceptions.handle(request, ignore=True)
         LOG.error("Unable to update environment name with ud={0}".format(
             data['environment_id'],
         ))
         return False
     return True
Exemplo n.º 2
0
 def handle(self, request, data):
     try:
         api.environment_update(request,
                                data['environment_id'],
                                data['name'])
     except Exception:
         exceptions.handle(request, ignore=True)
         LOG.error("Unable to update environment name with ud={0}".format(
             data['environment_id'],
         ))
         return False
     return True
Exemplo n.º 3
0
    def handle(self, request, data):
        try:
            env_id = self.initial['environment_id']
            env = api.environment_update(request, env_id, data['name'])

            messages.success(request,
                             "Edited environment '{0}'".format(data['name']))
            return env
        except exc.HTTPConflict:
            msg = _('Environment with specified name already exists')
            LOG.exception(msg)
            exceptions.handle(request, ignore=True)
            messages.error(request, msg)
        except Exception:
            name = data.get('name', '')
            msg = _("Unable to edit environment {0}").format(name)
            LOG.exception(msg)
            exceptions.handle(request)
            messages.error(request, msg)
Exemplo n.º 4
0
    def handle(self, request, data):
        try:
            env_id = self.initial['environment_id']
            env = api.environment_update(request, env_id, data['name'])

            messages.success(request,
                             "Edited environment '{0}'".format(data['name']))
            return env
        except exc.HTTPConflict:
            msg = _('Environment with specified name already exists')
            LOG.exception(msg)
            exceptions.handle(request, ignore=True)
            messages.error(request, msg)
        except Exception:
            name = data.get('name', '')
            msg = _("Unable to edit environment {0}").format(name)
            LOG.exception(msg)
            exceptions.handle(request)
            messages.error(request, msg)
Exemplo n.º 5
0
 def test_environment_update(self, mock_api):
     env_name = "test_env"
     env_api.environment_update(self.mock_request, self.env_id, env_name)
     env_api.api.muranoclient.assert_called_once_with(self.mock_request)
Exemplo n.º 6
0
 def test_environment_update(self, mock_api):
     env_name = "test_env"
     env_api.environment_update(self.mock_request, self.env_id, env_name)
     env_api.api.muranoclient.assert_called_once_with(self.mock_request)