def complete(self): """ Call this when you're all done """ assert self.state != self.COMPLETE self.log.info("Request %s completed with error=%s (%s)" % (self.id, self.error, self.error_message)) self.state = self.COMPLETE self.completed_at = now()
def _submit(self, commands=None): if commands is None: commands = self._commands else: commands = commands + [["osd stat", {"format": "json-pretty"}]] self.rados_commands = RadosCommands(self.id, commands) self.rados_commands.run() self.log.info("Request %s started" % (self.id, )) self.alive_at = now() return self.id
def _submit(self, commands=None): if commands is None: commands = self._commands else: commands = commands + [["osd stat", {"format": "json-pretty"}]] self.rados_commands = RadosCommands(self.id, commands) self.rados_commands.run() self.log.info("Request %s started" % (self.id,)) self.alive_at = now() return self.id
def __init__(self): """ Requiring cluster_name and fsid is redundant (ideally everything would speak in terms of fsid) but convenient, because the librados interface wants a cluster name when you create a client, and otherwise we would have to look up via ceph.conf. """ # getChild isn't in 2.6 logname = '.'.join((log.name, self.__class__.__name__)) self.log = logging.getLogger(logname) self.requested_at = now() self.completed_at = None # This is actually kind of overkill compared with having a counter, # somewhere but it's easy. self.id = uuid.uuid4().__str__() self.state = self.NEW self.result = None self.error = False self.error_message = "" # Time at which we last believed the current JID to be really running self.alive_at = None