Skip to content

Conversation

@ravening
Copy link
Member

@ravening ravening commented Dec 3, 2019

Description

By default, once we create a security group we cant change its name.
In this feature, we introduce a new API command "updateSecurityGroup"
which allows us to rename the security group name. Although we can't
change the name of the "default" security group.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Screenshots (if appropriate):

Navigate to "Network" section in the main window and select "Security groups" from the drop-down menu in the top left section

Click on "Add Security group" to create a new security group
Screenshot 2019-12-03 at 16 04 49

Once the security group is created you can rename it using the edit button

Screenshot 2019-12-03 at 16 06 33

How Has This Been Tested?

  1. Navigate to "Network" tab in the main UI.
  2. Select "Security groups" from the drop-down menu in the top left.
  3. Click on "Add Security group" on the top right to create a new security group.
  4. Give any suitable name and create it.
  5. Now select the security group you just created and click on edit button to enter the new name
    Screenshot 2019-12-03 at 16 02 45
  6. This will rename the security group to the new name
  7. Now again try to edit the security group name and enter blank spaces. You will get error message which indicates that security group name cannot be empty.
    Screenshot 2019-12-03 at 16 04 01

Testing

New integration test case has been added which validates different test cases in updating the security group name. This can be run using

nosetests --with-marvin --marvin-config=<config file> test/integration/component/test_update_security_group.py

@ravening ravening force-pushed the feature_update_securitygroup branch from 0d7ff87 to b1a5aa6 Compare January 16, 2020 09:12
@wido wido self-requested a review January 16, 2020 09:20
Copy link
Contributor

@wido wido left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on the code

@yadvr yadvr added this to the 4.14.0.0 milestone Jan 28, 2020
@yadvr
Copy link
Member

yadvr commented Jan 28, 2020

@ravening few points:

Copy link
Member

@yadvr yadvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my comment.

By default, once we create a security group we cant change its name.
In this feature, we introduce a new API command "updateSecurityGroup"
which allows us to rename the security group name. Although we can't
change the name of the "default" security group.
@ravening ravening force-pushed the feature_update_securitygroup branch from b1a5aa6 to d8a442e Compare January 30, 2020 09:55
@ravening
Copy link
Member Author

@ravening few points:

@rhtyd I have made the necessary changes. Please review it again

@yadvr
Copy link
Member

yadvr commented Jan 31, 2020

thanks @ravening
@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-725

@yadvr
Copy link
Member

yadvr commented Jan 31, 2020

@blueorangutan test

@blueorangutan
Copy link

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@yadvr
Copy link
Member

yadvr commented Feb 6, 2020

@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@yadvr yadvr requested a review from DaanHoogland February 6, 2020 06:05
@yadvr
Copy link
Member

yadvr commented Feb 6, 2020

I did not test it.

@blueorangutan
Copy link

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-763

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm, remarks are definitely not -1-worthy. I am planning a quick test in our lab (time and lab space are at short hand atm)


@Override
public String getCommandName() {
return s_name;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather see it constructed form the API name .toLower()+"response". no biggy

return securityGroup.getAccountId();
}

return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this an exceptional situation? wouldn't there always be at least root admin responsible for creating a sec-group?

public SecurityGroupVO doInTransaction(TransactionStatus status) {
SecurityGroupVO group = _securityGroupDao.lockRow(groupId, true);
if (group == null) {
throw new InvalidParameterValueException("Unable to find security group by id " + groupId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the message here could better be "unable to acquire lock for security group with id " + groupId

@DaanHoogland
Copy link
Contributor

tested and works, just one remark. I think this is a generic details page problem in cloudstack but after saving, the old name is still used instead of the altered one.

@andrijapanicsb
Copy link
Contributor

tested and works, just one remark. I think this is a generic details page problem in cloudstack but after saving, the old name is still used instead of the altered one.

log out and in, or force refresh page - I recall similar issues on other parts of the gui

@yadvr
Copy link
Member

yadvr commented Feb 12, 2020

@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✖centos6 ✖centos7 ✔debian. JID-819

@GabrielBrascher
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

@GabrielBrascher a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-841

@apache apache deleted a comment from blueorangutan Feb 13, 2020
@apache apache deleted a comment from blueorangutan Feb 13, 2020
@yadvr
Copy link
Member

yadvr commented Feb 14, 2020

@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✖centos6 ✖centos7 ✖debian. JID-862

@andrijapanicsb
Copy link
Contributor

will be regression tested in Trillian, when possible. thx

@yadvr
Copy link
Member

yadvr commented Feb 17, 2020

@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✖centos6 ✔centos7 ✖debian. JID-884

@yadvr
Copy link
Member

yadvr commented Feb 18, 2020

@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-889

@yadvr
Copy link
Member

yadvr commented Feb 18, 2020

@blueorangutan test

@blueorangutan
Copy link

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian test result (tid-1027)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 28042 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3739-t1027-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_vpn.py
Smoke tests completed. 79 look OK, 1 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_02_vpc_privategw_static_routes Failure 172.91 test_privategw_acl.py
test_03_vpc_privategw_restart_vpc_cleanup Failure 170.93 test_privategw_acl.py
test_04_rvpc_privategw_static_routes Failure 232.08 test_privategw_acl.py

@yadvr
Copy link
Member

yadvr commented Feb 19, 2020

@yadvr yadvr merged commit 4ab6b42 into apache:master Feb 19, 2020
nvazquez pushed a commit to shapeblue/cloudstack that referenced this pull request Feb 21, 2020
By default, once we create a security group we cant change its name.
In this feature, we introduce a new API command "updateSecurityGroup"
which allows us to rename the security group name. Although we can't
change the name of the "default" security group.
nvazquez pushed a commit to shapeblue/cloudstack that referenced this pull request Feb 21, 2020
By default, once we create a security group we cant change its name.
In this feature, we introduce a new API command "updateSecurityGroup"
which allows us to rename the security group name. Although we can't
change the name of the "default" security group.
ggoodrich-ipp pushed a commit to ippathways/cloudstack that referenced this pull request Feb 24, 2020
By default, once we create a security group we cant change its name.
In this feature, we introduce a new API command "updateSecurityGroup"
which allows us to rename the security group name. Although we can't
change the name of the "default" security group.
ustcweizhou pushed a commit to ustcweizhou/cloudstack that referenced this pull request Feb 28, 2020
By default, once we create a security group we cant change its name.
In this feature, we introduce a new API command "updateSecurityGroup"
which allows us to rename the security group name. Although we can't
change the name of the "default" security group.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants