diff options
author | Scott Moser <smoser@ubuntu.com> | 2015-02-10 20:53:20 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2015-02-10 20:53:20 -0500 |
commit | cd632b2f153a61faa48531cb41d0288650e72c71 (patch) | |
tree | a3a35b9ca437d999a15fdd25c0a0de88e3cafafb /cloudinit/distros/freebsd.py | |
parent | 78915c97c18d678db10e0fde0d9306823c5f4610 (diff) | |
parent | f5f280cae778bd214b91664f28d9eed997fbcda5 (diff) | |
download | vyos-cloud-init-cd632b2f153a61faa48531cb41d0288650e72c71.tar.gz vyos-cloud-init-cd632b2f153a61faa48531cb41d0288650e72c71.zip |
python3 support.
This gives us functional python3 support. There are likely
still bugs, but instance boot on openstack is functional now.
LP: #1247132
Diffstat (limited to 'cloudinit/distros/freebsd.py')
-rw-r--r-- | cloudinit/distros/freebsd.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cloudinit/distros/freebsd.py b/cloudinit/distros/freebsd.py index f1b4a256..4c484639 100644 --- a/cloudinit/distros/freebsd.py +++ b/cloudinit/distros/freebsd.py @@ -16,7 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -from StringIO import StringIO +import six +from six import StringIO import re @@ -203,8 +204,9 @@ class Distro(distros.Distro): redact_opts = ['passwd'] - for key, val in kwargs.iteritems(): - if key in adduser_opts and val and isinstance(val, basestring): + for key, val in kwargs.items(): + if (key in adduser_opts and val + and isinstance(val, six.string_types)): adduser_cmd.extend([adduser_opts[key], val]) # Redact certain fields from the logs @@ -271,7 +273,7 @@ class Distro(distros.Distro): nameservers = [] searchdomains = [] dev_names = entries.keys() - for (device, info) in entries.iteritems(): + for (device, info) in entries.items(): # Skip the loopback interface. if device.startswith('lo'): continue @@ -323,7 +325,7 @@ class Distro(distros.Distro): resolvconf.add_search_domain(domain) except ValueError: util.logexc(LOG, "Failed to add search domain %s", domain) - util.write_file(self.resolv_conf_fn, str(resolvconf), 0644) + util.write_file(self.resolv_conf_fn, str(resolvconf), 0o644) return dev_names |