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

Bug #1736750 reported by Akihiko Ota
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released

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

Revision history for this message
Akihiko Ota (sw37th) wrote :
description: updated
Akihiko Ota (sw37th)
description: updated
Revision history for this message
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.


Revision history for this message
Akihiko Ota (sw37th) wrote :


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

Scott Moser (smoser)
Changed in cloud-init:
status: New → Confirmed
importance: Undecided → Medium
Chad Smith (chad.smith)
Changed in cloud-init:
status: Confirmed → Fix Committed
Revision history for this message
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.

Revision history for this message
Scott Moser (smoser) wrote : Fixed in Cloud-init 18.1

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
Revision history for this message
James Falcon (falcojr) wrote :
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.