|
@@ -49,6 +49,7 @@ class PWDManager(object):
|
|
|
token, rd = self.recodepw(token)
|
|
|
self.rd = '&'.join([str(x) for x in rd])
|
|
|
self.logger.info('token created success.')
|
|
|
+ self.token = token
|
|
|
return token
|
|
|
except Exception, e:
|
|
|
self.logger.error("generate token faild!")
|
|
@@ -56,7 +57,7 @@ class PWDManager(object):
|
|
|
|
|
|
@property
|
|
|
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)
|
|
|
result = p2.communicate()
|
|
|
if result[-1]:
|