fill usrgws in check_usergw

This commit is contained in:
zhuyj17 2017-05-21 20:38:01 +08:00
parent 3785ff1cdb
commit a4fb1b8107
1 changed files with 4 additions and 1 deletions

View File

@ -525,9 +525,12 @@ class NetworkMgr(object):
return [True, 'delete user success']
def check_usergw(self, username, nodemgr, distributedgw=False):
if not self.has_user(username):
return [False,"user doesn't exist."]
self.load_usrgw(username)
if username not in self.usrgws.keys():
return [False, 'user does not exist.']
self.usrgws[username] = self.masterip
self.dump_usrgw(username)
ip = self.usrgws[username]
self.load_user(username)
if not distributedgw: