~shweta-ap05/neutron/shweta-l2network-plugin-persistence

« back to all changes in this revision

Viewing changes to quantum/plugins/cisco/ucs/cisco_getvif.py

Merging from Sumit's branch pylint fixes and incorporating review comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""
1
2
# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3
#
3
4
# Copyright 2011 Cisco Systems, Inc.  All rights reserved.
16
17
#
17
18
# @author: Rohit Agarwalla, Cisco Systems Inc.
18
19
#
19
 
import sys
 
20
"""
 
21
 
20
22
import subprocess
21
23
 
22
24
 
23
25
def get_next_dynic(argv=[]):
 
26
    """Get the next available dynamic nic on this host"""
24
27
    cmd = ["ifconfig", "-a"]
25
28
    f_cmd_output = subprocess.Popen(cmd, stdout=subprocess.PIPE).\
26
29
                   communicate()[0]
49
52
            if not used:
50
53
                break
51
54
    return eth
52
 
 
53
 
if __name__ == '__main__':
54
 
    #nic = get_next_dynic(sys.argv)
55
 
    nic = get_next_dynic()
56
 
    print nic