← Back to team overview

cloud-init-dev team mailing list archive

[Merge] lp:~harlowja/cloud-init/sudoers-fix into lp:cloud-init

 

Joshua Harlow has proposed merging lp:~harlowja/cloud-init/sudoers-fix into lp:cloud-init.

Requested reviews:
  cloud init development team (cloud-init-dev)
Related bugs:
  Bug #1079002 in cloud-init: "Sudoers writing broken when string"
  https://bugs.launchpad.net/cloud-init/+bug/1079002

For more details, see:
https://code.launchpad.net/~harlowja/cloud-init/sudoers-fix/+merge/134397

Strings are iterable...
-- 
https://code.launchpad.net/~harlowja/cloud-init/sudoers-fix/+merge/134397
Your team cloud init development team is requested to review the proposed merge of lp:~harlowja/cloud-init/sudoers-fix into lp:cloud-init.
=== modified file 'cloudinit/distros/__init__.py'
--- cloudinit/distros/__init__.py	2012-11-13 21:47:30 +0000
+++ cloudinit/distros/__init__.py	2012-11-15 03:24:17 +0000
@@ -24,7 +24,6 @@
 from StringIO import StringIO
 
 import abc
-import collections
 import itertools
 import os
 import re
@@ -421,7 +420,7 @@
             '',
             "# User rules for %s" % user,
         ]
-        if isinstance(rules, collections.Iterable):
+        if isinstance(rules, (list, tuple)):
             for rule in rules:
                 lines.append("%s %s" % (user, rule))
         else: