# -*- coding: utf-8 -*-
"""A model of an Openstack Infrastructure Node in CFME."""
from cfme.infrastructure.host import Host
from cfme.utils.appliance.implementations.ui import navigate_to
[docs]class OpenstackNode(Host):
"""
Model of Openstack Infrastructure node.
Extends the behavior of Infrastructure Host with Openstack-only functions.
For usage and __init__ args check the doc to Host class
"""
[docs] def toggle_maintenance_mode(self):
"""Initiate maintenance mode"""
view = navigate_to(self, 'Details')
view.toolbar.configuration.item_select('Toggle Maintenance Mode', handle_alert=True)
exp_msg = '"{}": Toggle Maintenance successfully initiated'.format(self.name)
view.flash.assert_success_message(exp_msg)
[docs] def provide_node(self):
"""Provide node - make it available"""
view = navigate_to(self, 'Details')
view.toolbar.configuration.item_select('Provide Node', handle_alert=True)
exp_msg = '"{}": Provide successfully initiated'.format(self.name)
view.flash.assert_success_message(exp_msg)
[docs] def run_introspection(self):
"""Run introspection"""
view = navigate_to(self, 'Details')
view.toolbar.configuration.item_select('Introspect Node', handle_alert=True)
exp_msg = '"{}": Introspect successfully initiated'.format(self.name)
view.flash.assert_success_message(exp_msg)