-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Intergrated ESI, allowing users to allocate ESI Network quotas
A new option `--esi` has been added to the `add_openstack_resource` command, allowing the creation of ESI resources in Coldfront. Allocations of ESI resources will be initialized with only a network quota of 1 floating IP and network by default. The implementation of this feature required subclassing of the `OpenstackResourceAllocator` to create an allocator class for ESI resources, changes to the various Coldfront commands, the addition of one Openstack quota attribute,a small modification to the CI and test files, and the addition of a test file for ESI allocations.
- Loading branch information
Showing
14 changed files
with
282 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import logging | ||
import functools | ||
import os | ||
|
||
from keystoneauth1.identity import v3 | ||
from keystoneauth1 import session | ||
|
||
from coldfront_plugin_cloud import attributes, utils | ||
from coldfront_plugin_cloud.openstack import OpenStackResourceAllocator | ||
|
||
class ESIResourceAllocator(OpenStackResourceAllocator): | ||
|
||
QUOTA_KEY_MAPPING = { | ||
'network': { | ||
'keys': { | ||
attributes.QUOTA_FLOATING_IPS: 'floatingip', | ||
attributes.QUOTA_NETWORKS: 'network' | ||
} | ||
} | ||
} | ||
|
||
QUOTA_KEY_MAPPING_ALL_KEYS = {quota_key: quota_name for k in QUOTA_KEY_MAPPING.values() for quota_key, quota_name in k['keys'].items()} | ||
|
||
resource_type = 'esi' | ||
|
||
def get_quota(self, project_id): | ||
quotas = dict() | ||
quotas = self._get_network_quota(quotas, project_id) | ||
return quotas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.