~smoser/cloud-init/trunk.new-ds

« back to all changes in this revision

Viewing changes to cloudinit/distros/parsers/sys_conf.py

  • Committer: Scott Moser
  • Date: 2015-02-11 01:53:20 UTC
  • mfrom: (1052.1.45 py2-3.smoser)
  • Revision ID: smoser@ubuntu.com-20150211015320-049dv6n1mk2in7l1
python3 support.

This gives us functional python3 support.  There are likely
still bugs, but instance boot on openstack is functional now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#    You should have received a copy of the GNU General Public License
17
17
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
18
 
19
 
from StringIO import StringIO
 
19
import six
 
20
from six import StringIO
20
21
 
21
22
import pipes
22
23
import re
69
70
        return out_contents.getvalue()
70
71
 
71
72
    def _quote(self, value, multiline=False):
72
 
        if not isinstance(value, (str, basestring)):
 
73
        if not isinstance(value, six.string_types):
73
74
            raise ValueError('Value "%s" is not a string' % (value))
74
75
        if len(value) == 0:
75
76
            return ''