run and run_on_all_machines error with command timed out

Bug #1530393 reported by Matt Dirba
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-jujuclient
New
Undecided
Unassigned

Bug Description

As shown below I am running jujuclient version 0.50.3 against juju-core version 1.25.0. I am unable to use both Environment.run and run_on_all_machines. They both error out with command timed out.

$ dpkg -l python-juju\* juju\*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
un juju <none> <none> (no description available)
ii juju-core 1.25.0-0ubun amd64 Juju is devops distilled - client
ii juju-deployer 0.6.1-1~ubun all Deploy complex stacks of services
ii juju-quickstar 2.2.4+bzr147 all Easy configuration of Juju enviro
un jujubundlelib <none> <none> (no description available)
ii python-jujubun 0.4.1-1~ubun all A Python2 library for working wit
ii python-jujucli 0.50.3-1~ubu amd64 Python API client for juju-core

python
Python 2.7.9 (default, Apr 2 2015, 15:33:21)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import jujuclient
>>> env = jujuclient.Environment.connect("maas")
print env.status()['Machines']
{u'0': {u'Hardware': u'arch=amd64 cpu-cores=1 mem=2048M tags=Intel_CPU,virtual', u'Life': u'', u'HasVote': True, u'Jobs': [u'JobManageEnviron', u'JobHostUnits'], u'Err': None, u'InstanceId': u'/MAAS/api/1.0/nodes/node-ff95f560-db5c-11e4-93f0-90e2ba4ffdec/', u'InstanceState': u'', u'AgentState': u'started', u'Agent': {u'Status': u'started', u'Info': u'', u'Kind': u'', u'Err': None, u'Since': u'2015-12-31T13:46:49.843255025-06:00', u'Life': u'', u'Version': u'1.25.0', u'Data': {}}, u'AgentStateInfo': u'', u'DNSName': u'kvminst-2.ast.arm.com', u'AgentVersion': u'1.25.0', u'Series': u'trusty', u'WantsVote': True, u'Id': u'0', u'Containers': {}}, u'2': {u'Hardware': u'arch=amd64 cpu-cores=24 mem=98304M tags=Intel_CPU,1p2658v3', u'Life': u'', u'HasVote': False, u'Jobs': [u'JobHostUnits'], u'Err': None, u'InstanceId': u'/MAAS/api/1.0/nodes/node-11b7e066-3a1f-11e5-932b-90e2ba4ffdec/', u'InstanceState': u'', u'AgentState': u'started', u'Agent': {u'Status': u'started', u'Info': u'', u'Kind': u'', u'Err': None, u'Since': u'2015-12-31T14:17:32.285143794-06:00', u'Life': u'', u'Version': u'1.25.0', u'Data': {}}, u'AgentStateInfo': u'', u'DNSName': u'1p2658v3-1.ast.arm.com', u'AgentVersion': u'1.25.0', u'Series': u'trusty', u'WantsVote': False, u'Id': u'2', u'Containers': {}}}
>>> env.run_on_all_machines("uptime")
{u'Results': [{u'Code': 0, u'Stdout': u'', u'MachineId': u'0', u'Error': u'command timed out', u'Stderr': u'', u'UnitId': u''}, {u'Code': 0, u'Stdout': u'', u'MachineId': u'2', u'Error': u'command timed out', u'Stderr': u'', u'UnitId': u''}]}
>>> env.run_on_all_machines("uptime", timeout=10000)
{u'Results': [{u'Code': 0, u'Stdout': u'', u'MachineId': u'0', u'Error': u'command timed out', u'Stderr': u'', u'UnitId': u''}, {u'Code': 0, u'Stdout': u'', u'MachineId': u'2', u'Error': u'command timed out', u'Stderr': u'', u'UnitId': u''}]}
>>> env.run("/usr/bin/uptime", machines=["0"])
{u'Results': [{u'Code': 0, u'Stdout': u'', u'MachineId': u'0', u'Error': u'command timed out', u'Stderr': u'', u'UnitId': u''}]}
>>> env.run("/bin/ls", machines=["0"])
{u'Results': [{u'Code': 0, u'Stdout': u'', u'MachineId': u'0', u'Error': u'command timed out', u'Stderr': u'', u'UnitId': u''}]}

Revision history for this message
Neale Pickett (neale) wrote :

try specifying a timeout= IN NANOSECONDS.

for instance:

env.run("/bin/ls", machines=["0"], timeout=30000000000)

Revision history for this message
Neale Pickett (neale) wrote :

Sorry, I put "in nanoseconds" in all caps because I thought it was funny. It wasn't meant to be a comment on anything else :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.