Adds decryption of passwords in vim config block 49/7149/1
authorBenjamin Diaz <bdiaz@whitestack.com>
Wed, 30 Jan 2019 16:01:54 +0000 (13:01 -0300)
committerBenjamin Diaz <bdiaz@whitestack.com>
Wed, 30 Jan 2019 16:02:37 +0000 (13:02 -0300)
Change-Id: Iba064f9fb0dd38511b90410c5073fc13ce8cbeac
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
osm_mon/server/server.py

index a1e848b..0f17d99 100755 (executable)
@@ -84,7 +84,16 @@ class Server:
                     values['vim_password'] = self.common_db.decrypt_vim_password(values['vim_password'],
                                                                                  values['schema_version'],
                                                                                  values['_id'])
+
+                    vim_config_encrypted = ("admin_password", "nsx_password", "vcenter_password")
+                    if 'config' in values:
+                        for key in values['config']:
+                            if key in vim_config_encrypted:
+                                values['config'][key] = self.common_db.decrypt_vim_password(values['config'][key],
+                                                                                            values['schema_version'],
+                                                                                            values['_id'])
                     self.auth_manager.store_auth_credentials(values)
+
                 if message.key == "delete":
                     self.auth_manager.delete_auth_credentials(values)