~smoser/cloud-init/azure_dhcp

« back to all changes in this revision

Viewing changes to cloudinit/dhclient_hook.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:
2
2
# vi: ts=4 expandtab
3
3
 
4
4
import os
5
 
import json
6
5
from cloudinit import stages
7
6
from cloudinit import log as logging
8
7
from cloudinit.atomic_write_json import atomic_write_json
16
15
        self.hooks_dir = self._get_hooks_dir()
17
16
        self.net_interface = cli_args.net_interface
18
17
        self.net_action = cli_args.net_action
19
 
        self.hook_file = os.path.join(self.hooks_dir, self.net_interface + ".join")
 
18
        self.hook_file = os.path.join(self.hooks_dir,
 
19
                                      self.net_interface + ".json")
20
20
 
21
21
    @staticmethod
22
22
    def _get_hooks_dir():
45
45
        envs = os.environ
46
46
        if self.hook_file is None:
47
47
            return
48
 
        atomic_write_json(self.hook_file, self.get_vals(envs) )
 
48
        atomic_write_json(self.hook_file, self.get_vals(envs))
49
49
        self.LOG.debug("Wrote dhclient options in %s", self.hook_file)