Commit 6c0fbd80 authored by Hugo Nicodemos's avatar Hugo Nicodemos
Browse files

Create new repo for cleaning server profile

parent f523b58e
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
# Copyright (2016-2017) Universidade Federal de Campina Grande
# All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from oneview_client import client
from oneview_client import exceptions
import os
import six.moves.configparser as config_parser
def clean_server_profile(node_info):
server_hardware = oneview_client.get_server_hardware(node_info)
sp_uri = server_hardware.server_profile_uri
print("TESTANDO: Powering off Server Hardware %s" % (
if sp_uri:
sp_uuid = sp_uri.split('/')[-1]
print("TESTANDO: Deleting server profile %s" % (sp_uuid))
print("TESTANDO: No applied Server Profile to delete")
except exceptions.OneViewResourceNotFoundError:
print("TESTANDO: Check server hardware URI")
if __name__ == "__main__":
config_file = os.path.join(os.path.dirname(__file__), 'test.conf')
config = config_parser.SafeConfigParser()
oneview_client = client.Client(
manager_url=config.get('oneview', 'manager_url'),
username=config.get('oneview', 'username'),
password=config.get('oneview', 'password'),
tls_cacert_file=config.get('oneview', 'tls_cacert_file')
node_info = {
'server_hardware_uri': config.get('node', 'server_hardware_uri')
minversion = 1.6
envlist = clean
skipsdist = True
setenv = VIRTUAL_ENV={envdir}
# .testr.conf uses TESTS_DIR
usedevelop = True
install_command = pip install -U {opts} {packages}
deps =
commands =
python integration_tests/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment