[bug 581] Fix parameter checking if no data-type
[osm/N2VC.git] / modules / libjuju / juju / unit.py
index ce33b08..3be27f2 100644 (file)
@@ -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,