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:
[email protected]


With regards,
Apache Git Services

Reply via email to