Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate hil cli #54

Closed
wants to merge 10 commits into from

Conversation

saacg
Copy link
Member

@saacg saacg commented Apr 17, 2017

(@portante I forgot to squash the commits before pushing to my origin, and then could no longer squash them. Is there a way to just make a pull request for the final commit, or squash them before merging? )

Note: If cloning branch to test, must have HIL api server and HIL network server running for the HilInventoryDriver to work)

modify hil-specific methods from hil/haas/cli.py (adapted by @vsemp) into
private helper methods in the HilInventoryDriver in order to provide a
simplifying layer of abstraction to make the code more readable and developer
friendly, while keeping all hil-specific actions encapsulated within the scope
of the hil-specific drivers. Remove hil dependencies from the rest call wrappers,
url creater, and status code checker and add them as class methods to the Quads
object in libquads. The methods were primarily inventory related and are
therefore placed in the HilInventoryDriver class. The HilNetworkDriver class
can access the inventory information it needs through use of a HilInventoryDriver
instance

The following changes were made to the following files:

- lib/hardware_services/inventory_drivers/HilInventoryDriver.py:
    - implement new private methods:
        - __list_projects
        - __project_create_network
        - __project_connect_node
        - __project_detach_node
        - __network_delete
        - __project_create
        - __project_delete
        - __list_nodes
        - __show_node
        - __node_connect_network
        - __node_detach_network

    - refactor existing public methods to use new private methods:
        - update_cloud
        - update_host
        - remove_cloud
        - remove_host
        - list_clouds
        - list_hosts

- lib/libquads.py:
    - add class methods to wrap rest calls:
        - quads_urlify
        - quads_status_code_check
        - quads_put
        - quads_post
        - quads_get
        - quads_delete

    - add new member variable for api server url:
        - hardware_service_url

- conf/quads.yml:
    - add hardware_service_url parameter in config file
        so it can be easily expanded to use other APIs than HIL

- bin/quads.py
    - add defaulthardwareserviceurl variable set to new config parameter
    - add --set-hardware-service-url command line option to set parameter
        dynamically

saacg added 10 commits April 15, 2017 11:37
modify hil-specific methods from hil/haas/cli.py (adapted by @vsemp) into
private helper methods in the HilInventoryDriver in order to provide a
simplifying layer of abstraction to make the code more readable and developer
friendly, while keeping all hil-specific actions encapsulated within the scope
of the hil-specific drivers. Remove hil dependencies from the rest call wrappers,
url creater, and status code checker and add them as class methods to the Quads
object in libquads. The methods were primarily inventory related and are
therefore placed in the HilInventoryDriver class. The HilNetworkDriver class
can access the inventory information it needs through use of a HilInventoryDriver
instance

The following changes were made to the following files:

    - lib/hardware_services/inventory_drivers/HilInventoryDriver.py:
        - implement new private methods:
            - __list_projects
            - __project_create_network
            - __project_connect_node
            - __project_detach_node
            - __network_delete
            - __project_create
            - __project_delete
            - __list_nodes
            - __show_node
            - __node_connect_network
            - __node_detach_network

        - refactor existing public methods to use new private methods:
            - update_cloud
            - update_host
            - remove_cloud
            - remove_host
            - list_clouds
            - list_hosts

    - lib/libquads.py:
        - add class methods to wrap rest calls:
            - quads_urlify
            - quads_status_code_check
            - quads_put
            - quads_post
            - quads_get
            - quads_delete

        - add new member variable for api server url:
            - hardware_service_url

    - conf/quads.yml:
        - add hardware_service_url parameter in config file
            so it can be easily expanded to use other APIs than HIL

    - bin/quads.py
        - add defaulthardwareserviceurl variable set to new config parameter
        - add --set-hardware-service-url command line option to set parameter
            dynamically
@vsemp
Copy link

vsemp commented Apr 17, 2017

Generally, looks fine. You can merge it.

But try not to use **kwargs when the arguments are known upfront in the future.

@portante
Copy link
Member

Merged via #56.

@portante portante closed this Apr 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants