~cloud-init-dev/cloud-init/trunk

« back to all changes in this revision

Viewing changes to cloudinit/sources/DataSourceSmartOS.py

  • Committer: Joshua Harlow
  • Date: 2016-07-13 22:18:46 UTC
  • Revision ID: harlowja@gmail.com-20160713221846-6c05ytkwpwavcgur
Fix SmartOS datasource usage of dict comprehensions

Show diffs side-by-side

added added

removed removed

Lines of Context:
718
718
 
719
719
    config = []
720
720
    for nic in network_data:
721
 
        cfg = {k: v for k, v in nic.items()
722
 
               if k in valid_keys['physical']}
 
721
        cfg = dict((k, v) for k, v in nic.items()
 
722
                   if k in valid_keys['physical'])
723
723
        cfg.update({
724
724
            'type': 'physical',
725
725
            'name': nic['interface']})
728
728
 
729
729
        subnets = []
730
730
        for ip, gw in zip(nic['ips'], nic['gateways']):
731
 
            subnet = {k: v for k, v in nic.items()
732
 
                      if k in valid_keys['subnet']}
 
731
            subnet = dict((k, v) for k, v in nic.items()
 
732
                          if k in valid_keys['subnet'])
733
733
            subnet.update({
734
734
                'type': 'static',
735
735
                'address': ip,