Commit 132ca5ff by jajapi

fixed updatePM.py

parent 9381e8e4
......@@ -4,7 +4,7 @@ import paramiko
import getpass
### read serverlists
serverlist = open("serverlist.txt", 'r')
serverlist = open("cms_serverlist.txt", 'r')
serverhost = serverlist.readlines()
......@@ -28,9 +28,11 @@ for svrhost in serverhost:
sftp=paramiko.SFTPClient.from_transport(transport)
filepath = '/home/orchard/Integration_uxen_check.sh'
localpath = '/home/developer/Project/CSCS/GuestPM/Integration/Integration_uxen_check.sh'
localpath = '/home/orchard/CSCS/GuestPM/Integration/Integration_uxen_check.sh'
sftp.put(localpath,filepath)
print("%s Successful updates" % host)
sftp.close()
transport.close()
import paramiko
import getpass
serverlist = open("cms_serverlist.txt", 'r')
serverhost = serverlist.readlines()
password = getpass.getpass("orchard password :")
username = "orchard"
port = 22
for name in serverhost:
host = name.strip()
transport = paramiko.Transport((host,port))
transport.connect(username=username, password=password)
sftp=paramiko.SFTPClient.from_transport(transport)
filepath = '/home/orchard/Integration_uxen_check.sh'
localpath = '/home/developer/Project/CSCS/GuestPM/Integration/Integration_uxen_check.sh'
sftp.put(localpath,filepath)
sftp.close()
transport.close()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment