projects
/
osm
/
N2VC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improved Primitive support and better testing
[osm/N2VC.git]
/
modules
/
libjuju
/
juju
/
unit.py
diff --git
a/modules/libjuju/juju/unit.py
b/modules/libjuju/juju/unit.py
index
fc597bf
..
3be27f2
100644
(file)
--- a/
modules/libjuju/juju/unit.py
+++ b/
modules/libjuju/juju/unit.py
@@
-1,6
+1,6
@@
import logging
import logging
-from dateutil.parser import parse as parse_date
+import pyrfc3339
from . import model
from .client import client
from . import model
from .client import client
@@
-21,7
+21,7
@@
class Unit(model.ModelEntity):
"""Get the time when the `agent_status` was last updated.
"""
"""Get the time when the `agent_status` was last updated.
"""
- return p
arse_dat
e(self.safe_data['agent-status']['since'])
+ return p
yrfc3339.pars
e(self.safe_data['agent-status']['since'])
@property
def agent_status_message(self):
@property
def agent_status_message(self):
@@
-42,7
+42,7
@@
class Unit(model.ModelEntity):
"""Get the time when the `workload_status` was last updated.
"""
"""Get the time when the `workload_status` was last updated.
"""
- return p
arse_dat
e(self.safe_data['workload-status']['since'])
+ return p
yrfc3339.pars
e(self.safe_data['workload-status']['since'])
@property
def workload_status_message(self):
@property
def workload_status_message(self):
@@
-122,7
+122,7
@@
class Unit(model.ModelEntity):
"""Run command on this unit.
:param str command: The command to run
"""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.
"""
:returns: A :class:`juju.action.Action` instance.
"""
@@
-131,6
+131,10
@@
class Unit(model.ModelEntity):
log.debug(
'Running `%s` on %s', command, self.name)
log.debug(
'Running `%s` on %s', command, self.name)
+ if timeout:
+ # Convert seconds to nanoseconds
+ timeout = int(timeout * 1000000000)
+
res = await action.Run(
[],
command,
res = await action.Run(
[],
command,