From Yaniv Bronhaim ybronhei@redhat.com:
Yaniv Bronhaim has posted comments on this change.
Change subject: client: add namespaces for methods ......................................................................
Patch Set 5:
(3 comments)
https://gerrit.ovirt.org/#/c/66704/5/lib/vdsm/client.py File lib/vdsm/client.py:
Line 116: return self.msg.format(self=self) Line 117: Line 118: Line 119: class TimeoutError(Error): Line 120: msg = ("Request {self.cmd} with the following parameters {self.args[0]} "
why args[0]?
args[0] because self.args is a tuple that includes the dict when using this kind of string declaration Line 121: "timed out after {self.timeout} seconds") Line 122: Line 123: def __init__(self, cmd, timeout, *args): Line 124: self.cmd = cmd
Line 119: class TimeoutError(Error): Line 120: msg = ("Request {self.cmd} with the following parameters {self.args[0]} " Line 121: "timed out after {self.timeout} seconds") Line 122: Line 123: def __init__(self, cmd, timeout, *args):
Use args, there is not need to support variable number of arguments since w
not sure I understand what order you refer to ... anyway, passing args here sends only the keys in the dict. we needed to use * to get the dict as is Line 124: self.cmd = cmd Line 125: self.timeout = timeout Line 126: self.args = args Line 127:
Line 171: self.StorageDomain = Namespace("StorageDomain", self._call) Line 172: self.StoragePool = Namespace("StoragePool", self._call) Line 173: self.Task = Namespace("Task", self._call) Line 174: self.VM = Namespace("VM", self._call) Line 175: self.Volume = Namespace("Volume", self._call)
The public client api is these namespaces, and close()
what do you mean? we have close method Line 176: Line 177: def _call(self, namespace, method_name, **kwargs): Line 178: """ Line 179: Client call method, executes a given command
vdsm-patches@lists.fedorahosted.org