コード例 #1
0
 def handle(self, request, data):
     try:
         api.tenant_update(request,
                           data['id'],
                           data['description'],
                           data['enabled'])
         messages.success(request,
                          '%s was successfully updated.'
                          % data['id'])
     except api_exceptions.ApiException, e:
         messages.error(request, 'Unable to update tenant: %s' % e.message)
コード例 #2
0
 def handle(self, request, data):
     try:
         LOG.info('Updating tenant with id "%s"' % data["id"])
         api.tenant_update(request, data["id"], data["description"], data["enabled"])
         messages.success(request, "%s was successfully updated." % data["id"])
     except api_exceptions.ApiException, e:
         LOG.error(
             "ApiException while updating tenant\n"
             'Id: "%s", Description: "%s", Enabled "%s"' % (data["id"], data["description"], data["enabled"]),
             exc_info=True,
         )
         messages.error(request, "Unable to update tenant: %s" % e.message)
コード例 #3
0
 def handle(self, request, data):
     try:
         LOG.info('Updating tenant with id "%s"' % data['id'])
         api.tenant_update(request, data['id'], data['description'],
                           data['enabled'])
         messages.success(request,
                          '%s was successfully updated.' % data['id'])
     except api_exceptions.ApiException, e:
         LOG.error('ApiException while updating tenant\n'
                   'Id: "%s", Description: "%s", Enabled "%s"' %
                   (data['id'], data['description'], data['enabled']),
                   exc_info=True)
         messages.error(request, 'Unable to update tenant: %s' % e.message)
コード例 #4
0
 def handle(self, request, data):
     try:
         LOG.info('Updating tenant with id "%s"' % data['id'])
         api.tenant_update(request,
                           data['id'],
                           data['description'],
                           data['enabled'])
         messages.success(request,
                          '%s was successfully updated.'
                          % data['id'])
     except api_exceptions.ApiException, e:
         LOG.error('ApiException while updating tenant\n'
                   'Id: "%s", Description: "%s", Enabled "%s"' %
                   (data['id'], data['description'], data['enabled']),
                   exc_info=True)
         messages.error(request, 'Unable to update tenant: %s' % e.message)
コード例 #5
0
    def test_tenant_update(self):
        DESCRIPTION = "aDescription"
        ENABLED = True

        account_api = self.stub_account_api()

        account_api.tenants = self.mox.CreateMockAnything()
        account_api.tenants.update(TEST_TENANT_ID, DESCRIPTION, ENABLED).AndReturn(TEST_RETURN)

        self.mox.ReplayAll()

        ret_val = api.tenant_update(self.request, TEST_TENANT_ID, DESCRIPTION, ENABLED)

        self.assertIsInstance(ret_val, api.Tenant)
        self.assertEqual(ret_val._apiresource, TEST_RETURN)

        self.mox.VerifyAll()