← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1744796] Re: cloud-init status traceback on successful Ec2

 

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

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1744796

Title:
  cloud-init status traceback on successful Ec2

Status in cloud-init:
  Fix Released

Bug description:
  On Ec2 successful deployments, the command cloud-init status hits the following traceback:
  cloud-init status
  Traceback (most recent call last):
    File "/usr/bin/cloud-init", line 11, in <module>
      load_entry_point('cloud-init==17.2', 'console_scripts', 'cloud-init')()
    File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 853, in main
      get_uptime=True, func=functor, args=(name, args))
    File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 2279, in log_time
      ret = func(*args, **kwargs)
    File "/usr/lib/python3/dist-packages/cloudinit/cmd/status.py", line 55, in handle_status_args
      status, status_detail, time = _get_status_details(init.paths)
    File "/usr/lib/python3/dist-packages/cloudinit/cmd/status.py", line 114, in _get_status_details
      CLOUDINIT_DISABLED_FILE, paths)
    File "/usr/lib/python3/dist-packages/cloudinit/cmd/status.py", line 96, in _is_cloudinit_disabled
      return (is_disabled, reason)
  UnboundLocalError: local variable 'reason' referenced before assignment

  
  In Ec2's case, modules-init is never run because we detect the datasource in init-local timeframe. As a result the status.json looks like this (note that start and finished are both null on mondules-init stage:
  {
   "v1": {
    "datasource": "DataSourceEc2Local",
    "init": {
     "errors": [],
     "finished": 1515706844.3537874,
     "start": 1515706843.7459064
    },
    "init-local": {
     "errors": [],
     "finished": 1515706841.0270455,
     "start": 1515706840.1508064
    },
    "modules-config": {
     "errors": [],
     "finished": 1515706846.916724,
     "start": 1515706846.218318
    },
    "modules-final": {
     "errors": [],
     "finished": 1515706847.6123502,
     "start": 1515706847.2455244
    },
    "modules-init": {
     "errors": [],
     "finished": null,
     "start": null
    },
    "stage": null
   }
  }

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1744796/+subscriptions


References