result from merge with gerrit
secop subdir only Change-Id: I65ab7049719b374ae3ec0259483e7e7d16aafcd1
This commit is contained in:
@ -126,7 +126,7 @@ class CmdParser:
|
||||
try:
|
||||
argformat % ((0,) * len(casts)) # validate argformat
|
||||
except ValueError as e:
|
||||
raise ValueError("%s in %r" % (e, argformat))
|
||||
raise ValueError("%s in %r" % (e, argformat)) from None
|
||||
|
||||
def format(self, *values):
|
||||
return self.fmt % values
|
||||
@ -153,7 +153,7 @@ class Change:
|
||||
self._reply = None
|
||||
|
||||
def __getattr__(self, key):
|
||||
"""return attribute from module key when not in self._valuedict"""
|
||||
"""return attribute from module key is not in self._valuedict"""
|
||||
if key in self._valuedict:
|
||||
return self._valuedict[key]
|
||||
return getattr(self._module, key)
|
||||
@ -174,9 +174,6 @@ class Change:
|
||||
self._valuedict.update(result)
|
||||
return self._reply
|
||||
|
||||
def __repr__(self):
|
||||
return 'Change<%s>' % ', '.join('%s=%r' % kv for kv in self._valuedict.items())
|
||||
|
||||
|
||||
class IOHandlerBase:
|
||||
"""abstract IO handler
|
||||
@ -245,7 +242,7 @@ class IOHandler(IOHandlerBase):
|
||||
contain the command separator at the end.
|
||||
"""
|
||||
querycmd = self.make_query(module)
|
||||
reply = module.sendRecv(changecmd + querycmd)
|
||||
reply = module.communicate(changecmd + querycmd)
|
||||
return self.parse_reply(reply)
|
||||
|
||||
def send_change(self, module, *values):
|
||||
@ -256,7 +253,7 @@ class IOHandler(IOHandlerBase):
|
||||
"""
|
||||
changecmd = self.make_change(module, *values)
|
||||
if self.CMDSEPARATOR is None:
|
||||
module.sendRecv(changecmd) # ignore result
|
||||
module.communicate(changecmd) # ignore result
|
||||
return self.send_command(module)
|
||||
return self.send_command(module, changecmd + self.CMDSEPARATOR)
|
||||
|
||||
@ -283,8 +280,6 @@ class IOHandler(IOHandlerBase):
|
||||
reply = self.send_command(module)
|
||||
# convert them to parameters
|
||||
result = self.analyze(module, *reply)
|
||||
module.log.debug('result of analyze_%s: %s', self.group,
|
||||
', '.join('%s=%r' % kv for kv in result.items()))
|
||||
for pname, value in result.items():
|
||||
setattr(module, pname, value)
|
||||
for pname in self.parameters:
|
||||
@ -327,7 +322,6 @@ class IOHandler(IOHandlerBase):
|
||||
change = Change(self, module, valuedict)
|
||||
if force_read:
|
||||
change.readValues()
|
||||
module.log.debug('call change_%s(%r)', self.group, change)
|
||||
values = self.change(module, change)
|
||||
if values is None: # this indicates that nothing has to be written
|
||||
return
|
||||
|
Reference in New Issue
Block a user