Source code for stepler.cli_clients.steps.baremetal
"""
-----------------------
Ironic CLI client steps
-----------------------
"""
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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 stepler.cli_clients.steps import base
from stepler.third_party import steps_checker
[docs]class CliIronicSteps(base.BaseCliSteps):
"""CLI Ironic client steps."""
@steps_checker.step
[docs] def ironic_node_list(self, check=True):
"""Step to get Ironic node list.
Args:
check (bool, optional): flag whether to check result or not
Returns:
tuple: (exit_code, stdout, stderr) - result of command shell
execution
Raises:
TimeoutExpired|AssertionError: if check failed after timeout
"""
cmd = 'ironic node-list'
result = self.execute_command(cmd, timeout=0, check=check)
return result
@steps_checker.step
[docs] def ironic_port_list(self, check=True):
"""Step to get Ironic port list.
Args:
check (bool, optional): flag whether to check result or not
Returns:
tuple: (exit_code, stdout, stderr) - result of command shell
execution
Raises:
TimeoutExpired|AssertionError: if check failed after timeout
"""
cmd = 'ironic port-list'
result = self.execute_command(cmd, timeout=0, check=check)
return result
@steps_checker.step
[docs] def ironic_chassis_list(self, check=True):
"""Step to get Ironic chassis list.
Args:
check (bool, optional): flag whether to check result or not
Returns:
tuple: (exit_code, stdout, stderr) - result of command shell
execution
Raises:
TimeoutExpired|AssertionError: if check failed after timeout
"""
cmd = 'ironic chassis-list'
result = self.execute_command(cmd, timeout=0, check=check)
return result
@steps_checker.step
[docs] def ironic_driver_list(self, check=True):
"""Step to get Ironic driver list.
Args:
check (bool, optional): flag whether to check result or not
Returns:
tuple: (exit_code, stdout, stderr) - result of command shell
execution
Raises:
TimeoutExpired|AssertionError: if check failed after timeout
"""
cmd = 'ironic driver-list'
result = self.execute_command(cmd, timeout=0, check=check)
return result