Skip to content

Commit

Permalink
Merge pull request #1134 from MirantisWorkloadMobility/devel
Browse files Browse the repository at this point in the history
Release 2016-08-17
  • Loading branch information
MirantisWorkloadMobility authored Aug 17, 2016
2 parents ad417e3 + 860dde3 commit d334423
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
6 changes: 6 additions & 0 deletions cloudferry/actions/filter/get_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ def run(self, **kwargs):
if utils.TENANTS_TYPE in filter_config:
search_opts_tenant = filter_config[utils.TENANTS_TYPE]

filtered_tenant = search_opts_tenant.get('tenant_id', ['INVALID'])[0]

for r in self.src_cloud.resources.values():
if hasattr(r, 'filter_tenant_id') and filtered_tenant != 'INVALID':
r.filter_tenant_id = filtered_tenant

return {
'search_opts': search_opts,
'search_opts_img': search_opts_img,
Expand Down
24 changes: 11 additions & 13 deletions cloudferry/lib/os/compute/nova_compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,20 @@ def _read_info_quotas(self):

for tenant_id in tenant_ids:
project_quota = self.get_quotas(tenant_id=tenant_id)
project_quota_info = self.convert_resources(project_quota,
None)
project_quota_info = self.convert_resources(project_quota, None)
project_quota_info['tenant_id'] = tenant_id
project_quotas.append(project_quota_info)
if self.config.migrate.migrate_user_quotas:
for user_id in user_ids:
if self.identity.roles_for_user(user_id, tenant_id):
user_quota = self.get_quotas(tenant_id=tenant_id,
user_id=user_id)
user_quota_info = self.convert_resources(
user_quota, None)
user_quota_info['tenant_id'] = tenant_id
user_quota_info['user_id'] = user_id
user_quotas.append(user_quota_info)
LOG.debug("Get quotas for tenant '%s' and user '%s'",
tenant_id, user_id)
user_quota = self.get_quotas(tenant_id=tenant_id,
user_id=user_id)
user_quota_info = self.convert_resources(
user_quota, None)
user_quota_info['tenant_id'] = tenant_id
user_quota_info['user_id'] = user_id
user_quotas.append(user_quota_info)

return project_quotas, user_quotas

Expand Down Expand Up @@ -431,9 +431,7 @@ def _deploy_resources(self, info, **kwargs):
self._deploy_quotas(info['project_quotas'], tenant_map)
self._deploy_quotas(info['user_quotas'], tenant_map, user_map)

new_info = self.read_info(target='resources')

return new_info
return info

def deploy(self, info, target='instances', **kwargs):
"""
Expand Down
2 changes: 1 addition & 1 deletion cloudferry_devlab/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ nose==1.3.7
nose-testconfig==0.9.1
sqlalchemy==1.0.12
PyMySQL==0.6.7
-e git+https://github.com/kevinastone/generator.git@nose-attribs#egg=test-generator
test-generator==0.1.2

0 comments on commit d334423

Please sign in to comment.