Browse Source

更新 'pyproject/SSHManager/passwd_changer/aumain.py'

heavensend 6 years ago
parent
commit
a93a2f5a75
1 changed files with 2 additions and 1 deletions
  1. 2 1
      pyproject/SSHManager/passwd_changer/aumain.py

+ 2 - 1
pyproject/SSHManager/passwd_changer/aumain.py

@@ -49,6 +49,7 @@ class PWDManager(object):
             token, rd = self.recodepw(token)
             token, rd = self.recodepw(token)
             self.rd = '&'.join([str(x) for x in rd])
             self.rd = '&'.join([str(x) for x in rd])
             self.logger.info('token created success.')
             self.logger.info('token created success.')
+            self.token = token
             return token
             return token
         except Exception, e:
         except Exception, e:
             self.logger.error("generate token faild!")
             self.logger.error("generate token faild!")
@@ -56,7 +57,7 @@ class PWDManager(object):
 
 
     @property
     @property
     def modifypwd(self):
     def modifypwd(self):
-        p1 = subprocess.Popen(['echo', self.tokengenerate], stdout=subprocess.PIPE)
+        p1 = subprocess.Popen(['echo', self.token], stdout=subprocess.PIPE)
         p2 = subprocess.Popen(['passwd', '--stdin', self.loginuser], stdin=p1.stdout, stdout=subprocess.PIPE)
         p2 = subprocess.Popen(['passwd', '--stdin', self.loginuser], stdin=p1.stdout, stdout=subprocess.PIPE)
         result = p2.communicate()
         result = p2.communicate()
         if result[-1]:
         if result[-1]: