-
Notifications
You must be signed in to change notification settings - Fork 8
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 #20 from digitronik/refactor
Refactor MiqBox
- Loading branch information
Showing
15 changed files
with
955 additions
and
759 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Authors | ||
|
||
- [Nikhil Dhandre](https://github.com/digitronik) | ||
- [Yadnyawalkya Tale](https://github.com/Yadnyawalkya) | ||
- [Ganesh Hubale](https://github.com/ganeshhubale) | ||
- [Parthvi Vala](https://github.com/valaparthvi) | ||
- [Md Nadeem](https://github.com/mnadeem92) |
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 +1,42 @@ | ||
# miqbox | ||
import click | ||
|
||
from miqbox.configuration import config | ||
from miqbox.images import images | ||
from miqbox.images import pull | ||
from miqbox.images import rmi | ||
from miqbox.miqbox import create | ||
from miqbox.miqbox import evmserver | ||
from miqbox.miqbox import kill | ||
from miqbox.miqbox import start | ||
from miqbox.miqbox import status | ||
from miqbox.miqbox import stop | ||
|
||
|
||
@click.version_option() | ||
@click.group() | ||
def main(): | ||
"""Spin ManageIQ/CFME Appliance locally with Virtualization.""" | ||
pass | ||
|
||
|
||
# Image commands | ||
main.add_command(images) | ||
main.add_command(pull) | ||
main.add_command(rmi) | ||
|
||
# MiqBox command | ||
main.add_command(status) | ||
|
||
# Appliance operations commands | ||
main.add_command(create) | ||
main.add_command(start) | ||
main.add_command(stop) | ||
main.add_command(kill) | ||
main.add_command(evmserver) | ||
|
||
# Configuration command | ||
main.add_command(config) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file was deleted.
Oops, something went wrong.
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,22 @@ | ||
import libvirt | ||
|
||
from miqbox.configuration import Configuration | ||
|
||
|
||
class Client(Configuration): | ||
"""Libvirt client | ||
Args: | ||
url (str): driver url | ||
""" | ||
def __init__(self, url=None, *args, **kwargs): | ||
super(Client, self).__init__(*args, **kwargs) | ||
self.url = url or self.libvirt.driver | ||
|
||
@property | ||
def driver(self): | ||
"""libvirt open connection""" | ||
try: | ||
return libvirt.open(self.url) | ||
except libvirt.libvirtError: | ||
print(f"Failed to open connection to {self.url}") |
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,25 @@ | ||
appliance: | ||
password: smartvm | ||
username: root | ||
images: ~/.miqbox/images | ||
libvirt: | ||
driver: qemu:///system | ||
storage_pool: | ||
name: miqbox | ||
path: /var/lib/libvirt/images/miqbox | ||
repositories: | ||
downstream: | ||
url: null | ||
versions: | ||
- '5.7' | ||
- '5.8' | ||
- '5.9' | ||
- '5.10' | ||
- '5.11' | ||
upstream: | ||
url: http://releases.manageiq.org | ||
versions: | ||
- gaprindashvili | ||
- hammer | ||
- ivanchuk | ||
- master |
Oops, something went wrong.