~harlowja/cloud-init/group-dict-fix

« back to all changes in this revision

Viewing changes to cloudinit/distros/debian.py

  • Committer: Joshua Harlow
  • Date: 2012-11-09 22:37:21 UTC
  • mfrom: (702.2.2 cloud-init)
  • Revision ID: harlowja@yahoo-inc.com-20121109223721-tq10b450d0n0l79v
Fix the fqdn/hostname case for rhel and ubuntu
where rhel uses the fqdn for its config while
ubuntu uses the short hostname.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
        else:
68
68
            return distros.Distro._bring_up_interfaces(self, device_names)
69
69
 
70
 
    def set_hostname(self, hostname):
 
70
    def set_hostname(self, hostname, fqdn=None):
71
71
        self._write_hostname(hostname, "/etc/hostname")
72
72
        LOG.debug("Setting hostname to %s", hostname)
73
73
        util.subp(['hostname', hostname])
76
76
        # "" gives trailing newline.
77
77
        util.write_file(out_fn, "%s\n" % str(hostname), 0644)
78
78
 
79
 
    def update_hostname(self, hostname, prev_fn):
 
79
    def update_hostname(self, hostname, fqdn, prev_fn):
80
80
        hostname_prev = self._read_hostname(prev_fn)
81
81
        hostname_in_etc = self._read_hostname("/etc/hostname")
82
82
        update_files = []