-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #150 from vivekkumac/pep8
autopep8: Adding automated tool to format extra/missing whitespace
- Loading branch information
Showing
36 changed files
with
2,043 additions
and
1,562 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
import random | ||
|
||
|
||
def generate_mac(): | ||
""" | ||
This function will generate a random MAC. | ||
The function generates a MAC with the Xensource, Inc. OUI '00:16:3E'. | ||
Care should be taken to ensure duplicates are not used. | ||
""" | ||
mac = [ 0x00, 0x16, 0x3e, | ||
random.randint(0x00, 0x7f), | ||
random.randint(0x00, 0xff), | ||
random.randint(0x00, 0xff) ] | ||
mac = [0x00, 0x16, 0x3e, | ||
random.randint(0x00, 0x7f), | ||
random.randint(0x00, 0xff), | ||
random.randint(0x00, 0xff)] | ||
return ':'.join(map(lambda x: "%02x" % x, mac)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.