How to remove duplicate lines and store output into one ine

   reservations = ec.describe_instances().get('Reservations', []) 

   for reservation in reservations:
        for instance in reservation['Instances']:
            tags = {}
            for tag in instance['Tags']:
                tags[tag['Key']] = tag['Value']
                if tag['Key'] == 'Name':
                    name=tag['Value']

            if not 'Owner' in tags or tags['Owner']=='unknown' or 
tags['Owner']=='Unknown':
                print name

Current Output:

aws-opsworks

aws-opsworks Ansible

Desired output:

aws-opsworks Ansible

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to