diff options
| author | Rui Chen <chenrui.momo@gmail.com> | 2016-03-21 16:29:14 +0800 |
|---|---|---|
| committer | Rui Chen <chenrui.momo@gmail.com> | 2016-03-24 10:33:23 +0800 |
| commit | 4cbcd02a5787f402a95c84da613d3f8cd7d09312 (patch) | |
| tree | 1280129ea1798fe1c4fc14d1896f7fc1409b192c /openstackclient/tests/compute/v2/fakes.py | |
| parent | 4b4349ee6821f08fb1483d5281d568081649a0d9 (diff) | |
| download | python-openstackclient-4cbcd02a5787f402a95c84da613d3f8cd7d09312.tar.gz | |
Add "aggregate unset" to osc
Support "aggregate unset" command in order to
remove the property of aggregate object in OSC.
Change-Id: I49645135586362f0fd251f5e4a4c03eff273d9e9
Closes-Bug: #1559866
Diffstat (limited to 'openstackclient/tests/compute/v2/fakes.py')
| -rw-r--r-- | openstackclient/tests/compute/v2/fakes.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/openstackclient/tests/compute/v2/fakes.py b/openstackclient/tests/compute/v2/fakes.py index 809825d0..2bb0fbfc 100644 --- a/openstackclient/tests/compute/v2/fakes.py +++ b/openstackclient/tests/compute/v2/fakes.py @@ -88,6 +88,38 @@ SERVICE = { } +class FakeAggregate(object): + """Fake one aggregate.""" + + @staticmethod + def create_one_aggregate(attrs=None): + """Create a fake aggregate. + + :param Dictionary attrs: + A dictionary with all attributes + :return: + A FakeResource object, with id and other attributes + """ + if attrs is None: + attrs = {} + + # Set default attribute + aggregate_info = { + "name": "aggregate-name-" + uuid.uuid4().hex, + "availability_zone": "ag_zone", + "hosts": [], + "id": "aggregate-id-" + uuid.uuid4().hex, + "metadata": { + "availability_zone": "ag_zone", + } + } + aggregate_info.update(attrs) + aggregate = fakes.FakeResource( + info=copy.deepcopy(aggregate_info), + loaded=True) + return aggregate + + class FakeComputev2Client(object): def __init__(self, **kwargs): |
