import logging
-from dateutil.parser import parse as parse_date
+import pyrfc3339
from . import model
from .client import client
"""Get the time when the `agent_status` was last updated.
"""
- return parse_date(self.safe_data['agent-status']['since'])
+ return pyrfc3339.parse(self.safe_data['agent-status']['since'])
@property
def agent_status_message(self):
"""Get the time when the `workload_status` was last updated.
"""
- return parse_date(self.safe_data['workload-status']['since'])
+ return pyrfc3339.parse(self.safe_data['workload-status']['since'])
@property
def workload_status_message(self):
"""Run command on this unit.
:param str command: The command to run
- :param int timeout: Time to wait before command is considered failed
+ :param int timeout: Time, in seconds, to wait before command is considered failed
:returns: A :class:`juju.action.Action` instance.
"""
log.debug(
'Running `%s` on %s', command, self.name)
+ if timeout:
+ # Convert seconds to nanoseconds
+ timeout = int(timeout * 1000000000)
+
res = await action.Run(
[],
command,