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)
| 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) |
nothing calls this directly
no test coverage detected