diff options
| author | Tang Chen <chen.tang@easystack.cn> | 2016-05-07 14:54:44 +0800 |
|---|---|---|
| committer | Tang Chen <chen.tang@easystack.cn> | 2016-05-07 14:54:44 +0800 |
| commit | 809239ca1e404c8077dd2499eafc8d12bd21c4cd (patch) | |
| tree | 74866853c66466504b2795ecc9989ab785df05b5 /openstackclient/tests/compute/v2/fakes.py | |
| parent | 2244915b506b7342e3e2ce6b0b3e88a38d13c390 (diff) | |
| download | python-openstackclient-809239ca1e404c8077dd2499eafc8d12bd21c4cd.tar.gz | |
Map server power state num to meanful string
In _prep_server_detail(), power_state is not formatted
by _format_servers_list_power_state(). So when executing
"server show" or "server create", the power state is
represented by number. This patch map the numbers to
meanful strings.
This patch also adds power_state attribute to FakeServer,
and improves unit tests for this attribute.
Change-Id: I2ec674327de4e5133b8712ba6bb53fa5ce55e3f4
Diffstat (limited to 'openstackclient/tests/compute/v2/fakes.py')
| -rw-r--r-- | openstackclient/tests/compute/v2/fakes.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/openstackclient/tests/compute/v2/fakes.py b/openstackclient/tests/compute/v2/fakes.py index 23957738..b3f3fb49 100644 --- a/openstackclient/tests/compute/v2/fakes.py +++ b/openstackclient/tests/compute/v2/fakes.py @@ -472,7 +472,8 @@ class FakeServer(object): }, 'flavor': { 'id': 'flavor-id-' + uuid.uuid4().hex, - } + }, + 'OS-EXT-STS:power_state': 1, } # Overwrite default attributes. |
