Ejemplo n.º 1
0
 def trigger(self, hook):
     message = sysadminctl_pb2.Command()
     message.trigger.hook = hook
     message.id = rand_uint32()
     response = self._send(message)
     assert response.id == message.id
     return response
Ejemplo n.º 2
0
 def rollback(self, id):
     message = sysadminctl_pb2.Command()
     message.rollback.id = id
     message.id = rand_uint32()
     response = self._send(message)
     assert response.id == message.id
     return response
Ejemplo n.º 3
0
 def _genericEmptyCommand(self, field):
     message = sysadminctl_pb2.Command()
     getattr(message, field).SetInParent()
     message.id = rand_uint32()
     if hasattr(self, "xid"):
         message.xid = self.xid
     response = self._send(message)
     assert response.id == message.id
     return response
Ejemplo n.º 4
0
 def _genericKeyCommand(self, command, key):
     message = sysadminctl_pb2.Command()
     setattr(getattr(message, command), "key", key)
     message.id = rand_uint32()
     if hasattr(self, "xid"):
         message.xid = self.xid
     response = self._send(message)
     assert response.id == message.id
     return response
Ejemplo n.º 5
0
 def commit(self, opt=sysadminctl_pb2.DEFAULT):
     message = sysadminctl_pb2.Command()
     message.commit.config = opt
     message.id = rand_uint32()
     if hasattr(self, "xid"):
         message.xid = self.xid
     response = self._send(message)
     assert response.id == message.id
     return response
Ejemplo n.º 6
0
 def set(self, key, value, override_type=None):
     message = sysadminctl_pb2.Command()
     message.set.key = key
     message.id = rand_uint32()
     if hasattr(self, "xid"):
         message.xid = self.xid
     if override_type is None:
         _unpackIntoProto(message.set.value, value)
     else:
         _overriddenTypeUnpack(message.set.value, value, override_type)
     response = self._send(message)
     assert response.id == message.id
     return response