|
@@ -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]:
|