summaryrefslogtreecommitdiff
path: root/openstackclient/compute/v2/security_group.py
Commit message (Collapse)AuthorAgeFilesLines
* Refactor security group rule list to use SDKRichard Theis2016-03-281-103/+0
| | | | | | | | | | | | | Refactored the 'os security group rule list' command to use the SDK when neutron is enabled, but continue to use the nova client when nova network is enabled. In addition, a release note was added to document the features and fixes resulting from this refactor. Change-Id: I24d04b720102ed1c60776e1ca67d4ca20e31b663 Partial-Bug: #1519512 Implements: blueprint neutron-client
* Refactor security group rule create to use SDKRichard Theis2016-03-231-65/+0
| | | | | | | | | | | | | Refactored the 'os security group rule create' command to use the SDK when neutron is enabled, but continue to use the nova client when nova network is enabled. Added a release note for the change in security group rules output due to Network v2. Change-Id: I8c6c99d5272ff5d410a449f73d198d834c5cd96e Partial-Bug: #1519512 Implements: blueprint neutron-client
* Refactor security group create to use SDKRichard Theis2016-03-101-32/+0
| | | | | | | | | | | | | | Refactored the 'os security group create' command to use the SDK when neutron is enabled, but continue to use the nova client when nova network is enabled. Added a release note for the change in security group rules output due to Network v2. The tenant_id column name was fixed to align with the 'os security group show' command. Change-Id: Ib29df42edcddcc73a123fff6a64743a6bfcb7fbf Partial-Bug: #1519511 Implements: blueprint neutron-client
* Refactor security group show to use SDKRichard Theis2016-03-101-54/+0
| | | | | | | | | | | | | | Refactored the 'os security group show' command to use the SDK when neutron is enabled, but continue to use the nova client when nova network is enabled. Added a release note for the change in security group rules output due to Network v2. The column names remain unchanged to maintain backwards compatibility. Change-Id: I25233ddb8115d18b8b88affb3de13346084a339d Partial-Bug: #1519511 Implements: blueprint neutron-client
* Refactor security group set to use SDKRichard Theis2016-03-031-41/+0
| | | | | | | | | | | | | Refactored the 'os security group set' 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 fixes a compute bug which ignores name and description when set to an empty value. Change-Id: I4225179dca4aedf799e1656ec49236bdedc5e9bd Partial-Bug: #1519511 Implements: blueprint neutron-client
* Refactor security group list to use SDKRichard Theis2016-02-291-54/+0
| | | | | | | | | | | | | | | | | | | | Refactored the 'os security group list' command to use the SDK when neutron is enabled, but continue to use the nova client when nova network is enabled. This refactor also removes the logic for displaying project names instead of project IDs when the --all-projects option is specified. This logic was removed because it is inconsistent with the other network commands. Since neutron will always display security groups across all projects for an admin, the --all-projects option is now hidden when neutron is enabled and the Project column is always displayed. Change-Id: I934a1f5084ef3c5f929d0ffd38ebf5064d799941 Partial-Bug: #1519511 Related-to: blueprint neutron-client
* Make SetSecurityGroup inherit from cliff.CommandTang Chen2016-02-271-10/+3
| | | | | | set/unset comamnd classes should inherit from cliff.Command class. Change-Id: Ie28711ac8823dc9eb13cf83877864ca436b928bc Partial-Bug: 1546065
* Refactor security group rule delete to use SDKRichard Theis2016-02-101-18/+0
| | | | | | | | | | | | | | 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
* Refactor security group delete to use SDKRichard Theis2016-02-021-22/+0
| | | | | | | | | | | | | | | | | | | | | | | 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
* log take_action parameters in a single placeAkihiro Motoki2016-02-021-39/+7
| | | | | | | | | | | | Previously each command logs take_action parameters explicitly by using @utils.log_method decorator or log.debug(). Some commands have no logging. This commit calls a logger in the base class and drops all logging definition from individual commands. Closes-Bug: #1532294 Change-Id: I43cd0290a4353c68c075bade9571c940733da1be
* Further improve output for "os security group show"Richard Theis2016-01-061-1/+19
| | | | | | | | | | | | | Improve the security group rules output when running the "os security group show" command. Empty and duplicate information for each security group rule is now removed. This will ensure that the rules remain readable when direction and ethertype information is returned as part of the transition to neutron networking. Change-Id: Ib49c27a9d7f4d5d38ceb2b0d785ddf94d88b2d89 Partial-Bug: #1519511 Related-To: blueprint neutron-client
* Merge "Add support to list all security group rules"Jenkins2016-01-041-11/+21
|\
| * Add support to list all security group rulesRichard Theis2015-12-171-11/+21
| | | | | | | | | | | | | | | | | | | | | | | | Both nova and neutron allow security group rules to be listed without specifying the owning security group. This patch set makes the group argument on 'os security group rule list' optional. Behavior is unchanged when the argument is specified. When the argument is not specified then all accessible security group rules will be listed. The listing will include the owning security group for each rule. Change-Id: I6914baecf70a65354e1e82dad92c6afbd32b4973 Related-Bug: #1519512
* | Improve output for "os security group show"Richard Theis2015-12-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve the security group rules output when running the "os security group show" command. Each security group rule is now displayed on a separate line. Current output example: $ openstack security group show default +-------------+------------------------- ... ---+ | Field | Value ... | +-------------+------------------------- ... ---+ | description | Default security group ... | | id | 048a5fc3-3be1-407d-ae47-9... | | name | default ... | | project_id | 3b96bb2020c1459da76963f9e... | | rules | [u"id='5d812367-9829-4340...t"] | +-------------+------------------------- ... ---+ New output example: +-------------+------------------------- ... ---+ | Field | Value ... | +-------------+------------------------- ... ---+ | description | Default security group ... | | id | 048a5fc3-3be1-407d-ae47-9... | | name | default ... | | project_id | 3b96bb2020c1459da76963f9e... | | rules | id='5d812367-9829-4340-95...lt' | | | id='ee451d1c-ade3-4975-8e...lt' | +-------------+------------------------- ... ---+ Change-Id: I1386075310896c58a2b776e2bbec3603bd00eff1 Partial-Bug: #1519511 Related-To: blueprint neutron-client
* | Merge "Trivial: Remove useless return from files in compute."Jenkins2015-12-161-2/+0
|\ \ | |/ |/|
| * Trivial: Remove useless return from files in compute.Tang Chen2015-12-171-2/+0
| | | | | | | | Change-Id: I9dc6749256fcd53d292d7f658912c032e9ce9df5
* | Remote security group name not displayed for ruleRichard Theis2015-12-141-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | The 'security group rule list' command was updated to display the remote security group name for a security group rule. This was done via a new 'Remote Security Group' column. The output of the 'security group rule create' and 'security group show' commands was also updated to include 'remote_security_group' information instead of the raw 'group' information returned from the API layer. Change-Id: I5f9600338c8331966d2c658109a24b502c538106 Closes-Bug: #1520003
* | Add source security group support to create ruleRichard Theis2015-12-071-2/+10
|/ | | | | | | | | | 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
* Switch to ksa SessionDean Troyer2015-12-021-2/+2
| | | | | | | | * Change session imports to keystoneauth1 * Change keystoneclient.exception imports to keystoneauth1 * Change exceptions raised from internal API from keystoneclient to openstack.common Change-Id: I046d89f561d6fe04baae53726f9749d2e7fe2056
* Refactor: Order of security group class namesRichard Theis2015-11-251-123/+123
| | | | | | | | | Per comment in [1], refactor the security group class names to be in alphabetical order. [1] https://review.openstack.org/#/c/249223 Change-Id: If28a153cdab57c0659ff5c78b276766d4043467f
* Doc: Add security group and security group ruleRichard Theis2015-11-241-10/+10
| | | | | | | | | Add missing command list documentation for the 'security group' and 'security group rule' commands. In addition, update the command description and argument help to fix minor issues and use consistent terminology. Change-Id: I9f4a3fbac5637289f19511874e16391d3fe27132
* Merge "Use a common decorator to log 'take_action' activation"Jenkins2015-09-111-4/+4
|\
| * Use a common decorator to log 'take_action' activationJoshua Harlow2015-09-011-4/+4
| | | | | | | | | | | | | | | | | | Instead of duplicating the same log statement throughout the code, the same logic can be provided by a shared decorator that abstracts away the logging capability and unifies it behind a common function instead. Change-Id: Icc63bced7347c8bbf0299a4c5821425a10892a79
* | Properly handle port arguments for ICMPDean Troyer2015-09-031-4/+7
|/ | | | | | | | | | The Compute API requires 'from_port' and 'to_port' to be -1 for ICMP security group rules. It happily accepts them empty or None but the resulting rules do not work. So we force the values for ICMP rules. Closes-bug: #1477629 Change-Id: Iba57211014caca16be7c9a28d15d4db2a6c51b8d
* Fix security group list commandTerryHowe2015-06-021-1/+1
| | | | | | | | | | | | Security group list command tries to get a project list and this may fail with a multitude of exceptions including but not limited to 401, 404, ConnectionRefused and EndpointNotFound. Rather than try to capture every possibility, this patch just catches the base class. Converting project ids to names is less important than having a working security group list command. Change-Id: I68214d2680bad907f9d04ad3ca2f62cf3feee028 Closes-Bug: #1459629
* Security group rule delete brokenTerryHowe2015-05-071-35/+4
| | | | | | | | | | Nova client was changed to take a rule id for security group rule delete. https://github.com/openstack/python-novaclient/blob/master/novaclient/v2/security_group_rules.py#L72 Change-Id: I0a69f3f196a36f267ee85a651b09aa8d3c328121 Closes-Bug: #1450872
* Merge "Fix security group create description bug"Jenkins2015-04-231-1/+3
|\
| * Fix security group create description bugDean Troyer2015-04-221-1/+3
| | | | | | | | | | | | | | | | --description is optional in our CLI but the server requires it to be non-empty. Set a default value of the given name. Closes-Bug: #1434172 Change-Id: I81507a77ad8d815000ff411784ae71e229c77f78
* | Security group rule create failsRamaraja Ramachandran2015-04-221-0/+1
|/ | | | | | | | | By default the --dst-port value is set to None when no --dst-port argument is provided. By making the default value (0, 0), this allows novaclient to proceed without any error. Change-Id: Ibb58f5df5ed1890a8f499dd2467b12b0e79d547b Closes-Bug: #1443963
* Merge "Fix help messages"Jenkins2015-03-061-2/+2
|\
| * Fix help messagesRamaraja2015-03-041-2/+2
| | | | | | | | | | | | | | | | Update help message for openstack security group rule delete Update help message for openstack security group rule list Change-Id: I017ffd424ca25b6c62193b91068eb1ba7de6c919 Closes-Bug: #1417854
* | Handle novaclient >2.20.0Dean Troyer2015-03-031-1/+6
|/ | | | | | | | | | As of 2.21.0 novaclient moved all of the v1_1 classes to v2 with a deprecation warning. The version-non-specific interfaces provided in novaclient.client are insufficient to support a few specific commands in OSC so we need to conditionally import directly from the correct classes. Closes-Bug: #1418024 Change-Id: I864b1908737803069dc1419c9cbca391b985c932
* Don't import form keystoneclient.openstack.commonJamie Lennox2014-12-171-1/+1
| | | | | | | | The keystoneclient.openstack.common directory is where we sync files from oslo incubator. It is not a public directory and should not be being consumed by openstackclient. Change-Id: I011bb95c2c824e2dbc4b822ca922ae77b8d9b955
* Fix security group list for non-adminDean Troyer2014-08-271-3/+9
| | | | | | | Non-admin users couldn't list security groups due to the project lookup failure. That shouldn't stop the listing. Change-Id: I27f6ff4975b35d1de1c852c8d4e830b83c7dec75
* replace string format arguments with function parametersChristian Berendt2014-05-201-8/+8
| | | | | | | | There are files containing string format arguments inside logging messages. Using logging function parameters should be preferred. Change-Id: Ic749ac9eb55564ed631d57055a5a4dfc3aebd169
* Fix format errors in nova security group rule listTerry Howe2014-02-201-7/+15
| | | | | | | | | | * port range was throwing exception for None to/from ports * ip_range didn't always have cidr causing error * ip_protocol None at times and looked bad Closes-Bug #1256935 Change-Id: I451a0f038a3e9646bca3f278c5d6f6d7e3097a83
* Add security group commandsDean Troyer2013-07-291-0/+394
* Add security group: create, delete, list, set, show * Add server: add secgroup, remove secgroup * Add security group rule: create, delete, list * Add Oslo's strutils and gettextutils * Adds parseractions.RangeAction() to handle option arguments of either a single number or a range of numbers: '--port 25' or '--port 1024:65535' Blueprint: nova-client Change-Id: Iad2de1b273ba29197709fc4c6a1036b4ae99725f