You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/02/20 21:10:06 UTC

[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #3903: VR: Send VM password to all Running VRs in network/vpc

DaanHoogland commented on a change in pull request #3903: VR: Send VM password to all Running VRs in network/vpc
URL: https://github.com/apache/cloudstack/pull/3903#discussion_r382254459
 
 

 ##########
 File path: server/src/main/java/com/cloud/network/element/VirtualRouterElement.java
 ##########
 @@ -702,18 +702,27 @@ public boolean savePassword(final Network network, final NicProfile nic, final V
 
         // If any router is running then send save password command otherwise
         // save the password in DB
+        boolean savePasswordResult = true;
+        boolean isVrRunning = false;
         for (final VirtualRouter router : routers) {
             if (router.getState() == State.Running) {
                 final boolean result = networkTopology.savePasswordToRouter(network, nic, uservm, router);
-                if (result) {
-                    // Explicit password reset, while VM hasn't generated a password yet.
-                    final UserVmVO userVmVO = _userVmDao.findById(vm.getId());
-                    userVmVO.setUpdateParameters(false);
-                    _userVmDao.update(userVmVO.getId(), userVmVO);
-                }
-                return result;
+                isVrRunning = true;
+                savePasswordResult = savePasswordResult & result;
 
 Review comment:
   is ok, but a former colleague scorned me for this once; why the bitwise and (single &), accidental?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services