juju-deployer address,port split not working with ipv6

Bug #1434458 reported by Merlijn Sebrechts
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-jujuclient
Fix Committed
Undecided
Liam Young

Bug Description

Hi

When using juju-deployer in an ipv6 environment, I get an error rendering juju-deployer useless. I suspect this is due to a too optimistic way of splitting an address in server and port part.

Traceback (most recent call last):
  File "/usr/bin/juju-deployer", line 9, in <module>
    load_entry_point('juju-deployer==0.4.3', 'console_scripts', 'juju-deployer')()
  File "/usr/lib/python2.7/dist-packages/deployer/cli.py", line 130, in main
    run()
  File "/usr/lib/python2.7/dist-packages/deployer/cli.py", line 228, in run
    importer.Importer(env, deployment, options).run()
  File "/usr/lib/python2.7/dist-packages/deployer/action/importer.py", line 194, in run
    self.env.connect()
  File "/usr/lib/python2.7/dist-packages/deployer/env/go.py", line 48, in connect
    self.client = EnvironmentClient.connect(self.name)
  File "/usr/lib/python2.7/dist-packages/jujuclient.py", line 460, in connect
    return Connector().run(cls, env_name)
  File "/usr/lib/python2.7/dist-packages/jujuclient.py", line 137, in run
    address = self.get_state_server(data)
  File "/usr/lib/python2.7/dist-packages/jujuclient.py", line 202, in get_state_server
    if self.is_server_available(s):
  File "/usr/lib/python2.7/dist-packages/jujuclient.py", line 223, in is_server_available
    address, port = server.split(":")
ValueError: too many values to unpack

I don't seem to get this error when connecting over ipv4

Related branches

Revision history for this message
Merlijn Sebrechts (merlijn-sebrechts) wrote :

Changing line 223 in/usr/lib/python2.7/dist-packages/jujuclient.py to

        address, port = server.rsplit(":", 1)
        address = address.translate(None, '[]')

seems to fix it. I'm not sure if that will work in all cases...

Revision history for this message
Richard Harding (rharding) wrote :

No, this should do proper IP parsing if it knows it's an IP address. Since you note the fix here is in python-jujuclient moving to that package.

affects: juju-deployer → python-jujuclient
Revision history for this message
Liam Young (gnuoy) wrote :

I've also hit this and confirm it's on ipv6 enabled environemnt and echoing back the server variable before the split gives

2015-05-11 11:29:53 Starting deployment of services
[fd31:d8a7:86e5:5721:f816:3eff:feaa:4e1b]:17070
Traceback (most recent call last):
  File "/usr/bin/juju-deployer", line 9, in <module>
    load_entry_point('juju-deployer==0.4.3', 'console_scripts', 'juju-deployer')()
  File "/usr/lib/python2.7/dist-packages/deployer/cli.py", line 130, in main
    run()
  File "/usr/lib/python2.7/dist-packages/deployer/cli.py", line 228, in run
    importer.Importer(env, deployment, options).run()
  File "/usr/lib/python2.7/dist-packages/deployer/action/importer.py", line 194, in run
    self.env.connect()
  File "/usr/lib/python2.7/dist-packages/deployer/env/go.py", line 48, in connect
    self.client = EnvironmentClient.connect(self.name)
  File "/usr/lib/python2.7/dist-packages/jujuclient.py", line 461, in connect
    return Connector().run(cls, env_name)
  File "/usr/lib/python2.7/dist-packages/jujuclient.py", line 137, in run
    address = self.get_state_server(data)
  File "/usr/lib/python2.7/dist-packages/jujuclient.py", line 202, in get_state_server
    if self.is_server_available(s):
  File "/usr/lib/python2.7/dist-packages/jujuclient.py", line 224, in is_server_available
    address, port = server.split(":")
ValueError: too many values to unpack

Liam Young (gnuoy)
Changed in python-jujuclient:
assignee: nobody → Liam Young (gnuoy)
status: New → Confirmed
Liam Young (gnuoy)
Changed in python-jujuclient:
status: Confirmed → Fix Committed
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.