SM gets password from server only, not cluster

Bug #1707784 reported by Tony Liu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R4.0
Fix Committed
Undecided
Siva Gurumurthy
R4.1
Fix Committed
Undecided
Siva Gurumurthy
Trunk
Fix Committed
Undecided
Siva Gurumurthy

Bug Description

4.0.0.0-20

connect() in ServerMgrSSHClient(object) in server_mgr_ssh_client.py reads password
from server only. If password is not configured in server, SM doesn't read it from cluster
and connection will fail.

    def connect(self, ip, server_id, option="key"):
        try:
            ssh = paramiko.SSHClient()
            ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
            match_dict = dict()
            match_dict["id"] = server_id
            server = self._serverDb.get_server(match_dict, detail=True)
            if len(server) == 1:
                server = server[0]
                if "ssh_private_key" in server and option == "key" and server["s
sh_private_key"]:
                    key = str(server["ssh_private_key"])
                    private_key = StringIO(key)
                    pkey = paramiko.RSAKey.from_private_key(private_key)
                    ssh.connect(ip, username='root', pkey=pkey, timeout=30)
                elif "password" in server and option == "password" and server["p
assword"]:
                    root_pwd = server["password"]
                    ssh.connect(ip, username='root', password=root_pwd, timeout=
30)
            self._ssh_client = ssh

Abhay Joshi (abhayj)
affects: opencontrail → juniperopenstack
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R4.0

Review in progress for https://review.opencontrail.org/36193
Submitter: sgurumurthy (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/36194
Submitter: sgurumurthy (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R4.0

Review in progress for https://review.opencontrail.org/36193
Submitter: sgurumurthy (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/36194
Submitter: sgurumurthy (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R4.1

Review in progress for https://review.opencontrail.org/36198
Submitter: sgurumurthy (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R4.0

Review in progress for https://review.opencontrail.org/36193
Submitter: sgurumurthy (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/36194
Submitter: sgurumurthy (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R4.1

Review in progress for https://review.opencontrail.org/36198
Submitter: sgurumurthy (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/36193
Committed: http://github.com/Juniper/contrail-server-manager/commit/4635e085c2bb9cb5666264a1ab9a09bd3bb2ed23
Submitter: Zuul (<email address hidden>)
Branch: R4.0

commit 4635e085c2bb9cb5666264a1ab9a09bd3bb2ed23
Author: sgurumurthy <email address hidden>
Date: Tue Oct 3 09:50:04 2017 -0700

Closes-Bug: #1707784
Get the server password if specified
If not get the password from the cluster

Change-Id: I28b090b1d7f2799bdcb21b635d024c5e0f4bd6e3

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/36194
Committed: http://github.com/Juniper/contrail-server-manager/commit/5adb4c8f5caa2d688c715e061d4a572edd2114db
Submitter: Zuul (<email address hidden>)
Branch: master

commit 5adb4c8f5caa2d688c715e061d4a572edd2114db
Author: sgurumurthy <email address hidden>
Date: Tue Oct 3 09:50:04 2017 -0700

Closes-Bug: #1707784
Get the server password if specified
If not get the password from the cluster

Change-Id: I28b090b1d7f2799bdcb21b635d024c5e0f4bd6e3

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/36198
Committed: http://github.com/Juniper/contrail-server-manager/commit/38bac18ddc071d31a997429ef819b0818afda42f
Submitter: Zuul (<email address hidden>)
Branch: R4.1

commit 38bac18ddc071d31a997429ef819b0818afda42f
Author: sgurumurthy <email address hidden>
Date: Tue Oct 3 09:50:04 2017 -0700

Closes-Bug: #1707784
Get the server password if specified
If not get the password from the cluster

Change-Id: I28b090b1d7f2799bdcb21b635d024c5e0f4bd6e3

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R4.0

Review in progress for https://review.opencontrail.org/36486
Submitter: sgurumurthy (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R4.1

Review in progress for https://review.opencontrail.org/36520
Submitter: sgurumurthy (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/36521
Submitter: sgurumurthy (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/36486
Committed: http://github.com/Juniper/contrail-server-manager/commit/0982a0d84d42fc8005902794fdf0af2c84c539a0
Submitter: Zuul (<email address hidden>)
Branch: R4.0

commit 0982a0d84d42fc8005902794fdf0af2c84c539a0
Author: sgurumurthy <email address hidden>
Date: Thu Oct 12 15:49:39 2017 -0700

Closes-Bug: #1707784
Get the server password if specified
If not get the password from the cluster

Change-Id: I6f77750590a31ff83e64bb3278bb526510a15ab8

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/36520
Committed: http://github.com/Juniper/contrail-server-manager/commit/277fcc9f2150a07c9a721da1c777c4936f0230df
Submitter: Zuul (<email address hidden>)
Branch: R4.1

commit 277fcc9f2150a07c9a721da1c777c4936f0230df
Author: sgurumurthy <email address hidden>
Date: Fri Oct 13 11:07:14 2017 -0700

Closes-Bug: #1707784
Get the server password if specified
If not get the password from the cluster

Change-Id: I8c2a06596aa23838ba89e2fe5afa1a3ec36105be

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/36521
Committed: http://github.com/Juniper/contrail-server-manager/commit/964a8e283eb854fec010f44f71b94bbb1a86bbf1
Submitter: Zuul (<email address hidden>)
Branch: master

commit 964a8e283eb854fec010f44f71b94bbb1a86bbf1
Author: sgurumurthy <email address hidden>
Date: Fri Oct 13 11:07:14 2017 -0700

Closes-Bug: #1707784
Get the server password if specified
If not get the password from the cluster

Change-Id: I8c2a06596aa23838ba89e2fe5afa1a3ec36105be

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.