sometimes properties within object store concepts are stored with
mixed case depending on the client used to store said properties.
when retrieving properties to 'show' the user, always call lower()
on the property in question when comparing it to the reserved
values of the swift API.
Change-Id: I97ffc715788ca3cd021413124b6945a399465c99
Closes-Bug: 1525805
Add "router list" command. It takes one "--long" option.
By default, the command will print router id, name, status,
admin state up, distributed, ha and project id.
With "--long" option, it will also print routes and
external gateway info.
Change-Id: I9d21904c41c11ee1fa107f985744878a1dc2f970
Implements: blueprint neutron-client
Partial-bug: #1519503
A unit test class similar to FakeServer, which is able to fake one
or more routers. It will be used by the router CRUD patches.
Change-Id: I9b87c6c95282902c3a829da51229a35d4265a1e4
Implements: blueprint neutron-client
Partial-bug: #1519503
1. "network delete" takes network name or ID, not project
2. "network set/show" takes network name or ID, not only name.
So use network, not name.
Change-Id: I13835fea1d0151ea0cd93e250b022c9daf74b537
Since "network delete" could delete more than one network,
add a (s) to the doc.
And also, rename the parameter "networks" to "network".
The naming style is not using plural format in parameter.
Change-Id: Id434ea905af34457f84ea6bcb18addef5800429a
Now that the neutron support is using the openstacksdk
requirement, the python-neutronclient requirement can
be removed.
Change-Id: Ieefac297e136f2f2997ec41cef2673e814c75b55
Related-to: blueprint neutron-client
In two steps:
1. Setup all necessary attributes of a server in setUp(), including
the ones that are not faked in FaseServer by default.
2. Run a similar process with no option test case.
The future plan is to move all these attributes to FakeServer.
But it will cause some other changes which has nothing to do with
this patch. So leave this job to do later.
Change-Id: I1134812a0ea146ef737b0f0ffbef8ca23684accd
Implements: blueprint osc-unit-test-framework-improvement
The previous patches have migrate all network commands to
the new version using sdk. This patch will remove the
temporary method, and implement a new make_client() to
create sdk network client.
And also, find() in openstackclient/network/common.py must
support sdk. The logic of this function will become much
easier than before, so this patch also removes two useless
test cases of find().
This patch will also remove the patched methods in tests.
Change-Id: Ic2f7bca073beb9757172d16f95d9b82c48cbbc12
Implements: blueprint neutron-client
Co-Authored-By: Terry Howe <terrylhowe@gmail.com>
Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
This patch makes "network show" command use sdk.
Since we have to keep the other commands runnable with
the old network client, we use a temporary method to
create sdk network client. And as a result, the tests
need to patch a method to fake the temporary method,
which will be removed at last.
There are two same test cases in the unit tests. This
patch will remove one.
And since the output has changed, we also need to fix
function test cases.
Change-Id: I4c06b4efad2db430767bbaa882b0876df3ab483a
Implements: blueprint neutron-client
Co-Authored-By: Terry Howe <terrylhowe@gmail.com>
Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
This patch makes "network set" command use sdk.
Since we have to keep the other commands runnable with
the old network client, we use a temporary method to
create sdk network client. And as a result, the tests
need to patch a method to fake the temporary method,
which will be removed at last.
Change-Id: I794ac4b82d9200747298f1a9ee44611140e9b6d0
Implements: blueprint neutron-client
Co-Authored-By: Terry Howe <terrylhowe@gmail.com>
Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
This patch makes "network delete" command use sdk.
Since we have to keep the other commands runnable with
the old network client, we use a temporary method to
create sdk network client. And as a result, the tests
need to patch a method to fake the temporary method,
which will be removed at last.
Change-Id: I1f2c404e4b0ff6727e4c535ce543aa406f2290ce
Implements: blueprint neutron-client
Co-Authored-By: Terry Howe <terrylhowe@gmail.com>
Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
This patch makes "network create" command use sdk.
Since we have to keep the other commands runnable with
the old network client, we use a temporary method to
create sdk network client. And as a result, the tests
need to patch a method to fake the temporary method,
which will be removed at last.
Change-Id: I06559c675be1188747257f72f18d6b4d420d0285
Implements: blueprint neutron-client
Co-Authored-By: Terry Howe <terrylhowe@gmail.com>
Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
This patch makes "network list" command use sdk.
Since we have to keep the other commands runnable with
the old network client, we use a temporary method to
create sdk network client. And as a result, the tests
need to patch a method to fake the temporary method,
which will be removed at last.
Change-Id: I0882501cd7bb2c17917e10a6da4298f1452c9765
Implements: blueprint neutron-client
Co-Authored-By: Terry Howe <terrylhowe@gmail.com>
Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
We have a class FakeVolume to fake one or more volumes. So use it in
test_server.py.
Change-Id: I735ae7f678a6799e0ae4c7c25c8083d9ebf47b09
Implements: blueprint improve-volume-unittest-framework
We have a class FakeImage to fake one or more images. So use it in
test_server.py.
Change-Id: I276e4ade5aecefbe66b9722c1dfbac10b3bd14b6
Implements: blueprint improve-image-unittest-framework
The 'security group rule create' command was updated to support a
source security group. Now either a source IP address block or source
security group can be specified when creating a rule. The default
remains the same.
Change-Id: If57de2871810caddeeaee96482eb34146968e173
Closes-Bug: #1522969
This patch adds a temporary method to create a network client using sdk.
This method will help to migrate network commands from neutronclient to sdk
one by one. The command which is being migrated will use this temporary
method to create the sdk client, and the rest ones will use the old client.
The temporary method will finally be removed and implement the same thing
in make_client().
This patch will also add sdk to requirements file.
And adds some formatter helper functions, which will be used in class
CreateNetwork, ListNetwork and ShowNetwork.
This patch is splited from TerryHowe <terrylhowe@gmail.com> 's original patch.
Change-Id: Ie9b35747680afeb66cf6922e2c654fbca7e03569
Implements: blueprint neutron-client
Co-Authored-By: TerryHowe <terrylhowe@gmail.com>
Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
Introduce a new class FakeNetwork to fake one or more Network
objects so that we don't need to initialize objects once and
once again in each test case.
Change-Id: I519e5368025946a737002a2e97bc218b65a78fa2
Implements: blueprint osc-network-unit-test-refactor
Related-to: blueprint neutron-client
We should use the formatter in the original code to set the
expected data in each test case.
The same problem exists in other test cases, like "server create".
But data structure in TestServerCreate is different from TestServerList,
so will fix the problem in another patch.
Change-Id: I233f7a91cd4cc1e996941e26ea85490fa3290572