summaryrefslogtreecommitdiff
path: root/openstackclient/network/common.py
Commit message (Collapse)AuthorAgeFilesLines
* neutron: autogenerate docsEric Fried2019-11-011-98/+101
| | | | | | | | | | | | | | | | | | | $namespace = openstack.network.v2 The subcommand documents for $namespace were hardcoded and thus prone to drift over time. This commit removes the hardcoded content and uses the autoprogram-cliff directive to generate them automatically from the subcommand configuration classes. This one turned out to be quite involved, because we support both neutron and nova-network. When running in a real cloud, the command classes detect whether the neutron service is present, assume nova-network if that service is not found, and only add parser options relevant to the detected service. But the docs need to present both sets of options. This was easy enough when they were hardcoded, but required a bit of additional infrastructure for generated docs. Change-Id: I426261eb1d86bcc68656aabd61f10b7f082da402
* Add dns-domain support to Network objectPierre Hanselmann2018-04-231-0/+25
| | | | | | | | | | | Add "dns-domain" parameter to Network class. Also check backend extensions and send an error message in case of an argument (like dns-domain) is sent and the extension is missing (dns-integration in this case). Change-Id: I7303658c27d9b9f2d8381ccea0b29e96909cab54 Closes-Bug: 1633214 Partial-Bug: 1547736
* Re-implement novaclient bits removed in 10.0Dean Troyer2018-03-131-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a) /os-floating-ips was removed in Compute API 2.36 and from novaclient's Python API in 10.0 Add to api.computev2: floating_ip_add() floating_ip_remove() Convert add floating IP command to nova-net/neutron split: "server add floating ip" "server remove floating ip" b) /os-hosts was removed in Compute API 2.43 and from novaclient's Python API in 10.0. Add to api.computev2: host_list() host_set() host_show() Convert host commands to use intenal api: "host list" "host set" "host show" c) The introduction of the Network-style commands into the server group broke cliff's autoprogram directive as it executes the get_parser() methods without fully initializing the Command object. NOTE: This is really three reviews squashed to get through the gate in one pass. Depends-on: Id6de87211d6c4ea8fd14aa9203d8d5b17e9e2f04 Change-Id: I5116086f9a9e4b2b31a744bf8f4558c79f0bfe59
* Show detailed message of neutron exceptionHongbin Lu2017-11-141-0/+2
| | | | | | | | This patch improves the error message by retrieving the more details from the exception instance. Otherwise, the real error message won't be displayed (unless using --debug in the command). Change-Id: I8ba694bda86f7cc8362e301b2044d9b610dde49c
* network.common.NetworkAndComputeShowOne: catch HttpExceptionJordan Pittier2016-11-101-6/+11
| | | | | | | | | | | | | | | | | Problem: if a user issue the cmd 'openstack floating ip create public' and has already maxed his quota for FIP, OSC exits with a not so useful message: >jordan@jordan-XPS13-9333:~ $ openstack floating ip create public >HttpException: Conflict This patches catch the HttpException earlier and prints a more verbose message: > jordan@jordan-XPS13-9333:~ $ openstack floating ip create public > Error while executing command: Quota exceeded for resources: ['floatingip'] Change-Id: I7c87524d871d230d92f007c32e06439b34c7194a
* Change to plural form of object in multi delete error message in networkv2Huanxuan Ao2016-07-141-1/+1
| | | | | | | | | | | | Usually, the error message of multi delete is: "'result' of 'total' 'objects' failed to delete" the objects is a plural form. To match the other multi delete error messages in OSC, change the object in delete error message in networkv2 to a plural form. Just add a 's' in the message. Change-Id: I17e0735d025bb61014db709d2639813565015b3d
* Standardize logger usageTang Chen2016-06-201-7/+11
| | | | | | | | | | | | | | | | | | | Use file logger for all command specific logs. This patch also fixes some usage that doesn't follow rules in: http://docs.openstack.org/developer/oslo.i18n/guidelines.html After this patch, all self.log and self.app.log will be standardized to LOG(). NOTE: In shell.py, we got the log in class OpenStackShell, which is also known as self.app.log in other classes. This logger is used to record non-command-specific logs. So we leave it as-is. Change-Id: I114f73ee6c7e84593d71e724bc1ad00d343c1896 Implements: blueprint log-usage
* osc-lib: commandDean Troyer2016-06-131-1/+1
| | | | | | | Leave command.py and test_command.py as a sanity check during the deprecation period. Change-Id: I24e1b755cbfbcbcaeb5273ec0c9706b82384fc85
* osc-lib: exceptionsDean Troyer2016-06-131-1/+2
| | | | | | | | Use osc-lib directly for exceptions. Leave openstackclient.common.exceptions for deprecation period. Change-Id: Iea3e862302372e1b31ccd27f69db59b4953ca828
* Trivial: Fix i18n support in network/common.pyTang Chen2016-05-311-4/+13
| | | | | | Some missing i18n problems in network. Change-Id: I45a09a6ada1aad5a64256c0d0a0a2b6e250df670
* Enhance exception handling for "network delete" commandTang Chen2016-04-141-0/+37
| | | | | | | | | | | | | This patch rework "network delete" command following the rules in doc/source/command-errors.rst. In "network delete" command, there are multiple REST API calls, and we should make as many of them as possible. And log error for each one, give a better error message. Also return a non-zero exit code. Change-Id: I39ae087dd7bd08d049d513abfa6c5cab2bd13b2b Partial-Bug: #1556719
* Merge "Refactor security group rule delete to use SDK"Jenkins2016-02-181-1/+7
|\
| * Refactor security group rule delete to use SDKRichard Theis2016-02-101-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactored the 'os security group rule delete' command to use the SDK when neutron is enabled, but continue to use the nova client when nova network is enabled. This patch set also introduces new FakeSecurityGroupRule classes for testing network and compute security group rules. And fixes were made to the network FakeSecurityGroup class. Change-Id: I8d0917925aa464e8255defae95a2a2adfb6cfb75 Partial-Bug: #1519512 Related-to: blueprint neutron-client
* | Add NetworkAndCompute Lister and ShowOne classesRichard Theis2016-02-121-0/+102
|/ | | | | | | | | | | | | This patch set introduces the NetworkAndComputeLister and NetworkAndComputeShowOne classes which are related to the NetworkAndComputeCommand class. These classes are for commands that must support neutron and nova network. The new classes allows both the parser and actions to be unique. Change-Id: I1b59264cd40aaf1062f4e8db233ccb7fd0e95f0e Partial-Bug: #1519511 Partial-Bug: #1519512 Related-to: blueprint neutron-client
* Refactor security group delete to use SDKRichard Theis2016-02-021-0/+62
| | | | | | | | | | | | | | | | | | | | | | | Refactored the 'os security group delete' command to use the SDK when neutron is enabled, but continue to use the nova client when nova network is enabled. This patch set introduces a new NetworkAndComputeCommand class to be used for commands that must support neutron and nova network. The new class allows both the parser and actions to be unique. The current DeleteSecurityGroup class is now a subclass of this new class and has moved under the network v2 commands. This patch set also introduces a new FakeSecurityGroup class for testing security groups. And finally, this patch set updates the command documentation for security group and security group rule to indicate that Network v2 is also used. Change-Id: Ic21376b86b40cc6d97f360f3760ba5beed154537 Partial-Bug: #1519511 Related-to: blueprint neutron-client
* SDK integration extensions and server create networksTerry Howe2015-12-091-29/+0
| | | | | | | Finish up the SDK integration with server create network and port find and extension list. Change-Id: I18dbada784d8aa92a45a937f251023ddf899c53e
* Migrate network client to SDK.Tang Chen2015-12-091-21/+3
| | | | | | | | | | | | | | | | | | | 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>
* Trivial: Fix typo in find() in network.Tang Chen2015-11-271-2/+4
| | | | Change-Id: Ic54fbb9160adefe3d025d537125e125128f75ee6
* Allow network find to use alternate nameTerry Howe2014-07-071-2/+4
| | | | | | | | Add the name_attr to the network find method so it can search for things like floating_ip_address for floating IP addresses rather than just id. Change-Id: I827e3745b06397a54555d1286e477bf2e05bf789
* Network CRUDTerry Howe2014-06-241-0/+43
bp/neutron https://wiki.openstack.org/wiki/OpenStackClient/Commands#Network_2 Change-Id: I89ee083154afa544b03587e84becace36d9d522a