DataSourceOpenNebula's get_mask() and get_network() return empty string

Bug #1736750 reported by Akihiko Ota on 2017-12-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

In DataSourceOpenNebula, get_mask() and get_network() check keys of CONTEXT Attributes, but doesn't check its values. If CONTEXT Attribute key ETH0_MASK and/or ETH0_NETWORK have no value, their methods should return default values, however actually return empty string('').

The problem occures when OpenNebula creats instances with Virtual Network resources which CONTEXT Attributes NETWORK_ADDRESS and/or NETWORK_MASK are not defined.

It seems that get_ip() also has the same bug.

I attached a patch for this problem.

Related branches

Akihiko Ota (sw37th) wrote :
description: updated
Akihiko Ota (sw37th) on 2017-12-07
description: updated
Scott Moser (smoser) wrote :

Thanks for filing a bug and even submitting a fix!

We use git and launchpad to do merge proposals. This is described at

Please note that in order to accept your fix you'll have to sign the Contributors Agreement. That process is also described in the hacking link above.

Please feel free to reach out if you have any questions.


Akihiko Ota (sw37th) wrote :


OK, I have created a merge request. Please review it.

Scott Moser (smoser) on 2017-12-14
Changed in cloud-init:
status: New → Confirmed
importance: Undecided → Medium
Chad Smith (chad.smith) on 2018-01-25
Changed in cloud-init:
status: Confirmed → Fix Committed
Chad Smith (chad.smith) wrote :

Hello Akihiko Ota, or anyone else affected,

As part of a stable release update, this changeset is committed and accepted cloud-init into artful-proposed and xenial-proposed as cloud-init version 17.2-35-gf576b2a2-0ubuntu1. The package is now available in the specific -proposed repository and can be installed and tested on artful and xenial instances with something like the following:

sed -i 's/ xenial / xenial-proposed /' /etc/apt/sources
sudo apt-get update
sudo apt-get install cloud-init;
sudo cloud-init clean --logs --reboot; # For a fresh install run

If there are concerns please comment on LP: #1747059.

This bug is believed to be fixed in cloud-init in 18.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers