~smoser/cloud-init/azure_dhcp

« back to all changes in this revision

Viewing changes to cloudinit/sources/helpers/azure.py

  • Committer: Brent Baude
  • Date: 2016-08-05 14:54:40 UTC
  • Revision ID: bbaude@redhat.com-20160805145440-bf0mkv0j4h0x9n35
Updates from testing

Show diffs side-by-side

added added

removed removed

Lines of Context:
270
270
        for interface in dhcp_options:
271
271
            _value = dhcp_options[interface].get('unknown_245', None)
272
272
            if _value is not None:
 
273
                LOG.debug("Endpoint server found in dhclient options")
273
274
                break
274
275
        return _value
275
276
 
279
280
        value = None
280
281
        # Option-245 stored in /run/cloud-init/dhclient.hooks/<ifc>.json
281
282
        # a dhclient exit hook that calls cloud-init-dhclient-hook
282
 
        LOG.debug("Lease file %s found", fallback_lease_file)
283
283
        dhcp_options = WALinuxAgentShim._load_dhclient_json()
284
284
        value = WALinuxAgentShim._get_value_from_dhcpoptions(dhcp_options)
285
285
        if value is None:
290
290
                LOG.warn("No fallback lease file was specified.")
291
291
                value = None
292
292
            else:
 
293
                LOG.debug("Looking for endpoint in lease file %s",
 
294
                          fallback_lease_file)
293
295
                value = WALinuxAgentShim._get_value_from_leases_file(
294
296
                    fallback_lease_file)
295
 
                LOG.debug("second value is {}".format(value))
296
297
 
297
298
        if value is None:
298
299
            raise ValueError('No endpoint found.')