diff options
author | Thierry ALLENO <thierry.alleno@orange.com> | 2018-09-17 15:55:10 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-09-19 21:25:58 +0200 |
commit | 0bd86756d5eb660bc9493a90a557aaff96d4dd17 (patch) | |
tree | 67acac07b694bf303025e175e20e4116807e6285 | |
parent | 7f7c5a6996f86bbc46ae83a49829c62c1dc688a8 (diff) |
Modify creation of SecGroup Rule for SSH
There is multiple "default" security groups, when user is created
with admin role.
Change-Id: I7555dc9461816dfdaaee36d82d712e25b4b65da7
Signed-off-by: Thierry ALLENO <thierry.alleno@orange.com>
(cherry picked from commit 7488f119f9d9c61c61ef55d53f87de0e671fed23)
-rw-r--r-- | functest/opnfv_tests/vnf/ims/cloudify_ims.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py index f7931b7b7..08699e4bb 100644 --- a/functest/opnfv_tests/vnf/ims/cloudify_ims.py +++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.py @@ -169,8 +169,18 @@ class CloudifyIms(cloudify.Cloudify): """Deploy Clearwater IMS.""" start_time = time.time() + secgroups = self.cloud.list_security_groups( + filters={'name': 'default', + 'project_id': self.project.project.id}) + if secgroups: + secgroup = secgroups[0] + else: + self.__logger.error("No 'default' security group in project %s", + self.project.project.name) + return False + self.cloud.create_security_group_rule( - 'default', port_range_min=22, port_range_max=22, + secgroup.id, port_range_min=22, port_range_max=22, protocol='tcp', direction='ingress') self.__logger.info("Upload VNFD") |