diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2008-05-08 10:09:08 -0400 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2008-05-08 10:09:08 -0400 |
commit | 072204fb8d3e351c2c6e67beb52de175cad0c979 (patch) | |
tree | 94cdd595ccace67f915e8467deb8570390783add /cobbler/remote.py | |
parent | e9cba0c5d8ca7356621a737a09b6a22d8b00e9fc (diff) | |
download | third_party-cobbler-072204fb8d3e351c2c6e67beb52de175cad0c979.tar.gz third_party-cobbler-072204fb8d3e351c2c6e67beb52de175cad0c979.tar.xz third_party-cobbler-072204fb8d3e351c2c6e67beb52de175cad0c979.zip |
Apply John Eckersberg's patch to allow random mac usage from the command line.
Diffstat (limited to 'cobbler/remote.py')
-rw-r--r-- | cobbler/remote.py | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/cobbler/remote.py b/cobbler/remote.py index 18c3947..749298e 100644 --- a/cobbler/remote.py +++ b/cobbler/remote.py @@ -475,25 +475,13 @@ class CobblerXMLRPCInterface: def get_random_mac(self,token=None): """ - Generate a random MAC address. - from xend/server/netif.py - Generate a random MAC address. - Uses OUI 00-16-3E, allocated to - Xensource, Inc. Last 3 fields are random. - return: MAC address string + Wrapper for utils.get_random_mac + + Used in the webui """ self.log("get_random_mac",token=None) self._refresh() - mac = [ 0x00, 0x16, 0x3e, - random.randint(0x00, 0x7f), - random.randint(0x00, 0xff), - random.randint(0x00, 0xff) ] - mac = ':'.join(map(lambda x: "%02x" % x, mac)) - systems = self.api.systems() - while ( systems.find(mac_address=mac) ): - mac = self.get_random_mac() - - return mac + return utils.get_random_mac(self.api) def _fix_none(self,data): """ |