X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=modules%2Flibjuju%2Fjuju%2Funit.py;h=3be27f2e91ba61978d3106929b9ac04ff9c1dc44;hp=ce33b083e51c3e8ae1efb753894c5b6adf0d626b;hb=refs%2Fchanges%2F94%2F6394%2F1;hpb=421c4a23dc5e60db9596b79ea87cdc19cc463e9b diff --git a/modules/libjuju/juju/unit.py b/modules/libjuju/juju/unit.py index ce33b08..3be27f2 100644 --- a/modules/libjuju/juju/unit.py +++ b/modules/libjuju/juju/unit.py @@ -122,7 +122,7 @@ class Unit(model.ModelEntity): """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. """ @@ -131,6 +131,10 @@ class Unit(model.ModelEntity): log.debug( 'Running `%s` on %s', command, self.name) + if timeout: + # Convert seconds to nanoseconds + timeout = int(timeout * 1000000000) + res = await action.Run( [], command,