summaryrefslogtreecommitdiff
path: root/openstackclient/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Implement "address scope show" command"Jenkins2016-05-111-0/+53
|\
| * Implement "address scope show" commandHuanxuan Ao2016-05-111-0/+53
| | | | | | | | | | | | | | | | This patch add a command that supports showing address scope details Change-Id: Ic0b41c1cab8c618904c7a6046d7493db5b74b430 Partial-Bug: #1566269
* | Merge "Implement "address scope list" command"Jenkins2016-05-112-0/+60
|\ \ | |/
| * Implement "address scope list" commandHuanxuan Ao2016-05-112-0/+60
| | | | | | | | | | | | | | | | This patch add a command that supports listing address scopes Change-Id: Id14757011560cacf28011ba51841a8e23b824f33 Partial-Bug: #1566269
* | Merge "Implement "address scope delete" command"Jenkins2016-05-111-0/+31
|\ \ | |/
| * Implement "address scope delete" commandHuanxuan Ao2016-05-111-0/+31
| | | | | | | | | | | | | | | | This patch add a command that supports deleting a address scope Change-Id: Ie028058c759b9511d105a530d7e89b841865e7d6 Partial-Bug: #1566269
* | Merge "Implement "address scope create" command"Jenkins2016-05-111-0/+164
|\ \ | |/
| * Implement "address scope create" commandHuanxuan Ao2016-05-111-0/+164
| | | | | | | | | | | | | | | | | | This patch supports creating a new address scope, with --ip-version,--project,--project-domain and --share or --no-share options. Change-Id: I37c73391a41ac239dd72d55dbc0adbebd7701f4a Partial-Bug: #1566269
* | Merge "Map server power state num to meanful string"Jenkins2016-05-092-1/+7
|\ \
| * | Map server power state num to meanful stringTang Chen2016-05-072-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Trivial: Remove unuseful comments for assertRaise() checking"Jenkins2016-05-075-16/+0
|\ \ \ | |/ / |/| |
| * | Trivial: Remove unuseful comments for assertRaise() checkingTang Chen2016-05-065-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | "Missing required args should bail here" is not understandable and not necessary. The code is obvious enough. And some of the comments are misused because of code copy. So remove them. Change-Id: I031395f2c882386c7a708db5cf4eee75393dc639
* | | Merge "Make "flavor show" command to show a private flavor properly"Jenkins2016-05-061-13/+9
|\ \ \ | |/ / |/| |
| * | Make "flavor show" command to show a private flavor properlyHuanxuan Ao2016-05-021-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "flavor show" command could not show a private flavor by flavor name becauce it could not find a private flavor by flavor name. In "until.find_resource(parsed_args.flavor)", If parsed_args.falvor is a name of a flavor, "flavors.find(name=parsed_args.flavor)"will be called to find a flavor.But the default value of "is_public" is "Ture" in "flavors.find()" so that we can only find public flavors.If we want to find all flaovrs by flavor name,we should add "is_public=None" in "flavors.find()". So I tried to change "until.find_resource(parsed_args.flavor)" to "until.find_resource(parsed_args.flavor, is_public=None)", but then I could not find any flavor by flavor id because "is_public" is an unexpected argument of "flavors.get()" in "until.find_resource()". In this case,I think "until.find_resource()" can not find a private flavor properly,and we should combine "manager.get(flavor.id)" and "manager.find(name=flavor.name, is_public=None)" by ourselve to find a flavor. Also,this bug affects other flavor commands like "flavor set/unset/delete",so I fix them in this patch too. Change-Id: I4a4ed7b0a2f522ee04d1c3270afcda7064285c39 Closes-Bug: #1575478
* | | Remove unnecessary type conversions in network unit testsTang Chen2016-05-065-46/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | In some tests, when comparing the results data with the expected ones, many unnecessary type conversions are used. So remove them to clean up. Change-Id: I560ca78a3ab5e7b99087bfe1667de500f92c68de Partial-bug: #1550633
* | | Merge "Add a unit test for "flavor create" command"Jenkins2016-05-052-2/+162
|\ \ \
| * | | Add a unit test for "flavor create" commandHuanxuan Ao2016-05-042-2/+162
| |/ / | | | | | | | | | | | | | | | | | | There was not a unit test for "flavor create" command in the "test_flavor.py".So I add the unit test. Change-Id: Ib1e821ea524eb33c0ba73643164228c7b83253b4
* | | Merge "Fix router set --route option"Jenkins2016-05-031-6/+9
|\ \ \
| * | | Fix router set --route optionRichard Theis2016-04-182-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the "--route" option on the "os router set" command. The option did not properly format the new routes to set which resulted in a "HttpException: Bad Request" error. In addition, the output for routes was fixed to improve readability and to align with the "--route" option on the "os router set" command. Change-Id: I9c514153ec201e2feae32be6dd281771e3298b9c Closes-Bug: #1564460
* | | | remove assert in favor an if/elseMichael McCune2016-05-021-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the assert usage in the NonNegativeAction has the potential to allow unexpected behavior when the python is byte-compiled with optimization turned on. Changes * remove assert in favor of if/else in NonNegativeAction class * add type specifier to parser arguments for non-negative actions * correct tests for new int based values Change-Id: I093e7440b8beff4f179e2c4ed81daff82704c40e Closes-Bug: #1576375
* | | | Merge "Fixes BadRequest when no --pool-prefix given"Jenkins2016-05-021-1/+14
|\ \ \ \ | |_|/ / |/| | |
| * | | Fixes BadRequest when no --pool-prefix givenInessa Vasilevskaya2016-04-271-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | --pool-prefix is made required on subnetpool creation. Closes-bug: #1536479 Change-Id: I3d183e45e9b96bc08011c36f45ec2b7a9c01b627
* | | | Merge "Fix error in flavor set/unset command"Jenkins2016-04-281-4/+8
|\ \ \ \
| * | | | Fix error in flavor set/unset commandHuanxuan Ao2016-04-281-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the "flavor set/unset" command,the "flavor" parameter can be a name but can not be a id of a flavor. I think we should find a flavor by using "utils.find_resource()" in these commands. Change-Id: I5836788f7ed18813f1ebde31bb808b7c3f932b80 Closes-Bug: #1575624
* | | | | Merge "Support for volume service list"Jenkins2016-04-284-0/+464
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Support for volume service listSheel Rana2016-04-254-11/+475
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OSC does not support to list volume services. This patch will provide support for adding volume service related support. Closes-bug:#1550999 Implements: bp cinder-command-support Change-Id: I50ac14aeb96c4b8ddbf7b33e519feea0d126f752
* | | | | Merge "Support quota show for current project"Jenkins2016-04-251-0/+11
|\ \ \ \ \ | |_|/ / / |/| | | |
| * | | | Support quota show for current projectRichard Theis2016-04-211-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "os quota show" command "<project/class>" argument is now optional. If not specified, the user's current project is used. This allows non-admin users to show quotas for their current project. Change-Id: I602d4cc09c9d29ce84271eff78137f8810cb1a47 Closes-Bug: #1572733
* | | | | Merge "Add new share and default parms to subnet pool cmds"Jenkins2016-04-211-0/+86
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Add new share and default parms to subnet pool cmdsBrad Behle2016-04-201-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the "share" and "default" parms to subnet pool create command. Add the "default" and "no-default" parms to subnet pool set command. Note that "share" can not be modified once subnet pool has been created, so do not add this to the set command. Change-Id: I1eecad69527a1cde7fb234669f4aff2be2db491e Partial-Bug: #1544591 Partial-Bug: #1544586
* | | | | Merge "Add "server group show" command"Jenkins2016-04-201-0/+23
|\ \ \ \ \
| * | | | | Add "server group show" commandRui Chen2016-04-201-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support compute v2 "server group show" command in OSC. Implements: blueprint nova-server-group-support Closes-Bug: #1542171 Change-Id: I1a6d103151c704bda5b67cb9a49cc43c7d9f1d6a
* | | | | | Merge "Fix mutable default arguments in tests"Jenkins2016-04-205-56/+85
|\ \ \ \ \ \ | |/ / / / / |/| | | | |
| * | | | | Fix mutable default arguments in testsTang Chen2016-04-205-56/+85
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Python’s default arguments are evaluated only once when the function is defined, not each time the function is called. This means that if you use a mutable default argument (like list and dict) and mutate it, you will and have mutated that object for all future calls to the function as well. More details about this wrong usage here: http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments In unit tests, most FakeXXX classes' methods take mutable arguments with default values [] or {}. We should change them to None. Change-Id: Iea833b66aa1379829511ad5c6d4432b72f3488e2 Closed-bug: #1550320
* | | | | Add "server group list" commandRui Chen2016-04-201-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support compute v2 "server group list" command in OSC. Implements: blueprint nova-server-group-support Partial-Bug: #1542171 Change-Id: I68b80e3c4458692472af671028cd1f939736bcb8
* | | | | Add "server group delete" commandRui Chen2016-04-201-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support compute v2 "server group delete" command in OSC. Implements: blueprint nova-server-group-support Partial-Bug: #1542171 Related-Bug: #1563301 Change-Id: I7d792d669b147b24dc774844cfc9dbacd60d017b
* | | | | Add "server group create" commandRui Chen2016-04-202-0/+142
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support compute v2 "server group create" command in OSC. Implements: blueprint nova-server-group-support Partial-Bug: #1542171 Change-Id: I96ffb07764d3adb715e048943cfee3b879c280f6
* | | | Merge "Rename --profile to --os-profile"2.4.0Jenkins2016-04-191-1/+1
|\ \ \ \
| * | | | Rename --profile to --os-profileDean Troyer2016-04-191-1/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * The --profile global option is deprecated but will be supported through at least April 2017. * Update man page Closes-bug: #1571812 Change-Id: I2e623411a56096b4cc352f4eedbf770632ae2cc3
* | | | Merge "Add provider network options to osc network set"Jenkins2016-04-191-0/+9
|\ \ \ \
| * | | | Add provider network options to osc network setreedip2016-04-191-0/+9
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following patch adds the provider network options to OSC "network set". Change-Id: I23b617077eda25d16164172a8e280082750eaf18 Partial-Bug: #1545537
* | | | Merge "Add options to security group rule list"Jenkins2016-04-191-16/+83
|\ \ \ \ | |/ / / |/| | |
| * | | Add options to security group rule listRichard Theis2016-04-181-16/+83
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the following options to the 'os security group rule list' command: --long: Display direction and ethertype for Network v2 --all-projects: Display information from all projects for Compute v2 Change-Id: If8a1cbd7669cdfa6577d6d2f6fffd9e999a39a82 Partial-Bug: #1519512 Implements: blueprint neutron-client
* | | Merge "Remove methods argument from vloume/v2/fakes.py"Jenkins2016-04-181-9/+3
|\ \ \ | |/ / |/| |
| * | Remove methods argument from vloume/v2/fakes.pyTang Chen2016-04-181-9/+3
| | | | | | | | | | | | | | | | | | | | | methods argument in FakeAvailabilityZone class is not necessary. Remove it. Change-Id: Idf136bf90bd94e7045b0d471b8e03cd843693251
* | | Merge "Propagate AttributeErrors when lazily loading plugins"Jenkins2016-04-181-0/+8
|\ \ \ | |/ / |/| |
| * | Propagate AttributeErrors when lazily loading pluginsTim Burke2016-04-141-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, if an AttributeError was raised in a plugin's make_client method, the plugin simply wouldn't be an attribute of the ClientManager, producing tracebacks like Traceback (most recent call last): File ".../openstackclient/shell.py", line 118, in run ret_val = super(OpenStackShell, self).run(argv) ... File ".../openstackclient/object/v1/container.py", line 150, in take_action data = self.app.client_manager.object_store.container_list( File ".../openstackclient/common/clientmanager.py", line 66, in __getattr__ raise AttributeError(name) AttributeError: object_store This made writing minimal third-party auth plugins difficult, as it obliterated the original AttributeError. Now, AttributeErrors that are raised during plugin initialization will be re-raised as PluginAttributeErrors, and the original traceback will be preserved. This gives much more useful information to plugin developers, as in Traceback (most recent call last): File ".../openstackclient/shell.py", line 118, in run ret_val = super(OpenStackShell, self).run(argv) ... File ".../openstackclient/object/v1/container.py", line 150, in take_action data = self.app.client_manager.object_store.container_list( File ".../openstackclient/common/clientmanager.py", line 57, in __get__ err_val, err_tb) File ".../openstackclient/common/clientmanager.py", line 51, in __get__ self._handle = self.factory(instance) File ".../openstackclient/object/client.py", line 35, in make_client interface=instance._interface, File ".../openstackclient/common/clientmanager.py", line 258, in get_endpoint_for_service_type endpoint = self.auth_ref.service_catalog.url_for( PluginAttributeError: 'NoneType' object has no attribute 'url_for' Change-Id: I0eee7eba6eccc6d471a699a381185c4e76da10bd
* | | Merge "Remove methods argument from FakeHypervisorStats"Jenkins2016-04-161-2/+1
|\ \ \
| * | | Remove methods argument from FakeHypervisorStatsTang Chen2016-04-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | methods argument is not necessary in FakeHypervisorStats class. Remove it. Change-Id: I288f71b412beb3e583e957a9fd99210bc6f3f543
* | | | Add support for removing volume-type-accessSheel Rana2016-04-161-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OSC does not support to remove volume type access to project. This feature will provide support to remove volume type access from project. Closes-Bug:#1554890 Implements: bp cinder-command-support Change-Id: I029a4292da05f028e8937962cb845ec6e00b0279