-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
73 changed files
with
1,944 additions
and
977 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ | |
/rpm/vmango.spec | ||
/rpm/*.tar.gz | ||
/deb/*.tar.gz | ||
/.vscode/ |
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
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env python | ||
from __future__ import print_function | ||
import os | ||
import sys | ||
|
||
|
||
def lookup(): | ||
assert "VMANGO_MACHINE_HWADDR" in os.environ | ||
assert "VMANGO_MACHINE_NAME" in os.environ | ||
assert "VMANGO_MACHINE_PLAN" in os.environ | ||
assert "VMANGO_MACHINE_ID" in os.environ | ||
print("44.43.42.41") | ||
|
||
|
||
def assign(): | ||
assert "VMANGO_MACHINE_HWADDR" in os.environ | ||
assert "VMANGO_MACHINE_NAME" in os.environ | ||
assert "VMANGO_MACHINE_PLAN" in os.environ | ||
assert "VMANGO_MACHINE_ID" in os.environ | ||
print("44.43.42.41") | ||
|
||
|
||
def release(): | ||
assert "VMANGO_MACHINE_HWADDR" in os.environ | ||
assert "VMANGO_MACHINE_IP" in os.environ | ||
assert "VMANGO_MACHINE_NAME" in os.environ | ||
assert "VMANGO_MACHINE_PLAN" in os.environ | ||
assert "VMANGO_MACHINE_ID" in os.environ | ||
|
||
|
||
def error(): | ||
sys.stderr.write("Unknown action requested\n") | ||
return 1 | ||
|
||
def main(): | ||
handlers = { | ||
"lookup-ip": lookup, | ||
"assign-ip": assign, | ||
"release-ip": release, | ||
} | ||
return handlers.get(sys.argv[1], error)() | ||
|
||
|
||
if __name__ == '__main__': | ||
sys.exit(main() or 0) |
Oops, something went wrong.