MCPcopy Create free account
hub / github.com/canonical/cloud-init / setup

Method setup

cloudinit/sources/DataSourceVMware.py:287–317  ·  view source on GitHub ↗

setup(is_new_instance) This is called before user-data and vendor-data have been processed. Unless the datasource has set mode to 'local', then networking per 'fallback' or per 'network_config' will have been written and brought up the OS at this point.

(self, is_new_instance)

Source from the content-addressed store, hash-verified

285 return False
286
287 def setup(self, is_new_instance):
288 """setup(is_new_instance)
289
290 This is called before user-data and vendor-data have been processed.
291
292 Unless the datasource has set mode to 'local', then networking
293 per 'fallback' or per 'network_config' will have been written and
294 brought up the OS at this point.
295 """
296
297 host_info = wait_on_network(self.metadata)
298 LOG.info("got host-info: %s", host_info)
299
300 # Reflect any possible local IPv4 or IPv6 addresses in the guest
301 # info.
302 advertise_local_ip_addrs(host_info, self.rpctool, self.rpctool_fn)
303
304 # Ensure the metadata gets updated with information about the
305 # host, including the network interfaces, default IP addresses,
306 # etc.
307 self.metadata = util.mergemanydict([self.metadata, host_info])
308
309 # Set the extra udev rules based on the configured network
310 # drivers from the metadata or based on the default drivers.
311 self.init_extra_hotplug_udev_rules()
312
313 # Persist the instance data for versions of cloud-init that support
314 # doing so. This occurs here rather than in the get_data call in
315 # order to ensure that the network interfaces are up and can be
316 # persisted with the metadata.
317 self.persist_instance_data()
318
319 def activate(self, cfg, is_new_instance):
320 """activate(cfg, is_new_instance)

Callers

nothing calls this directly

Calls 4

wait_on_networkFunction · 0.85
advertise_local_ip_addrsFunction · 0.85
persist_instance_dataMethod · 0.45

Tested by

no test coverage detected