~harlowja/cloud-init/py2-3

« back to all changes in this revision

Viewing changes to cloudinit/mergers/m_list.py

  • Committer: Joshua Harlow
  • Date: 2014-07-08 04:39:03 UTC
  • Revision ID: harlowja@yahoo-inc.com-20140708043903-5iyejdnrab2yvo79
Fix all iteritems() usage and remove (str, basestring) usage

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
import six
 
20
 
19
21
DEF_MERGE_TYPE = 'replace'
20
22
MERGE_TYPES = ('append', 'prepend', DEF_MERGE_TYPE, 'no_replace')
21
23
 
73
75
                return old_v
74
76
            if isinstance(new_v, (list, tuple)) and self._recurse_array:
75
77
                return self._merger.merge(old_v, new_v)
76
 
            if isinstance(new_v, (str, basestring)) and self._recurse_str:
 
78
            if isinstance(new_v, six.string_types) and self._recurse_str:
77
79
                return self._merger.merge(old_v, new_v)
78
80
            if isinstance(new_v, (dict)) and self._recurse_dict:
79
81
                return self._merger.merge(old_v, new_v)