~ubuntu-branches/ubuntu/utopic/xen/utopic

« back to all changes in this revision

Viewing changes to tools/python/xen/remus/vif.py

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2010-05-06 15:47:38 UTC
  • mto: (1.3.1) (15.1.1 sid) (4.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100506154738-agoz0rlafrh1fnq7
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from xen.remus.util import canonifymac
 
2
 
 
3
class VIF(object):
 
4
    def __init__(self, **props):
 
5
        self.__dict__.update(props)
 
6
        if 'mac' in props:
 
7
            self.mac = canonifymac(props['mac'])
 
8
 
 
9
    def __str__(self):
 
10
        return self.mac
 
11
 
 
12
def parse(props):
 
13
    "turn a vm device dictionary into a vif object"
 
14
    return VIF(**props)