]> Frank Brehm's Git Trees - my-stuff/ipv6-hostpart.git/commitdiff
External rausgenommen
authorFrank Brehm <frank@brehm-online.com>
Tue, 4 Jan 2011 15:59:45 +0000 (15:59 +0000)
committerFrank Brehm <frank@brehm-online.com>
Tue, 4 Jan 2011 15:59:45 +0000 (15:59 +0000)
git-svn-id: http://svn.brehm-online.com/svn/my-stuff/ipv6-hostpart/trunk@184 ec8d2aa5-1599-4edb-8739-2b3a1bc399aa

bin/net/ll_hw_address.py

index 97e631ddc9bf4599d907b4a800bc830a095b3101..587941d71c0541fe8330492e9bd68419c659fc85 100755 (executable)
@@ -133,16 +133,13 @@ class LlHardwareAddress(LoggingObject):
         if self.address is None:
             return None
 
-        def format_byte( byte ):
-            return "{0:02x}".format( byte )
-
         return_value = '<undef>'
         if self.type == 'guid':
             return_value = '0x'
             for byte in self.address:
                 return_value += "{0:02x}".format( byte )
         elif self.type == 'mac':
-            return_value = ':'.join( map( format_byte, self.address ) )
+            return_value = ':'.join( map( lambda b: "{0:02x}".format( b ), self.address ) )
 
         return return_value
 
@@ -192,10 +189,7 @@ class LlHardwareAddress(LoggingObject):
         if self.verbose >= 2:
             self.logger.debug( "Nibblelist to display: {0!r}.".format( pp.pformat( nibble_list ) ) )
 
-        def format_nibble( nibble ):
-            return "{0:x}".format( nibble )
-
-        return ':'.join( map( format_nibble, nibble_list ) )
+        return ':'.join( map( lambda n: "{0:x}".format( n ), nibble_list ) )
 
     #------------------------------------------------------