airgun.views.oscappolicy

Module Contents

Classes

SCAPPoliciesView

Base view for Satellite pages

ScapPolicyRadioGroup

Handle an HTML non normalized Radio group according to the current

SCAPPolicyCreateView

Base view for Satellite pages

SCAPPolicyEditView

Base view for Satellite pages

SCAPPolicyDetailsView

Base view for Satellite pages

class airgun.views.oscappolicy.SCAPPoliciesView(parent, logger=None, **kwargs)

Base view for Satellite pages

title
new
table
property is_displayed

Overrides the Widget.is_displayed(). The difference is that if the view does not have the root locator, it assumes it is displayed.

Returns

bool

class airgun.views.oscappolicy.ScapPolicyRadioGroup(parent, locator, logger=None)

Handle an HTML non normalized Radio group according to the current architecture.

Note: This is a temporary solution, a fix will be issued upstream,

when the fix will be available downstream we should replace the implementation with RadioGroup.

Example html representation:

<div>
<input type="radio" value="ansible" name="policy[deploy_by]" id="policy_deploy_by_ansible">
property button_names

Return all radio group labels

_get_parent_label(name)

Get radio group label for specific button

class airgun.views.oscappolicy.SCAPPolicyCreateView(parent, logger=None, **kwargs)

Base view for Satellite pages

class deployment_options(parent, logger=None, **kwargs)

Base view for Satellite pages

TAB_NAME = Deployment Options
next_step
deploy_by
after_fill(was_change)

A hook invoked after all the widgets were filled.

If it returns None, the was_changed in fill() does not change. If it returns a boolean, that boolean will be returned as was_changed.

Parameters

was_changebool signalizing whether the fill() changed anything,

class policy_attributes(parent, logger=None, **kwargs)

Base view for Satellite pages

TAB_NAME = Policy Attributes
next_step
name
description
after_fill(was_change)

A hook invoked after all the widgets were filled.

If it returns None, the was_changed in fill() does not change. If it returns a boolean, that boolean will be returned as was_changed.

Parameters

was_changebool signalizing whether the fill() changed anything,

class scap_content(parent, logger=None, **kwargs)

Base view for Satellite pages

TAB_NAME = SCAP Content
next_step
scap_content_resource
xccdf_profile
tailoring_file
xccdf_profile_tailoring_file
after_fill(was_change)

A hook invoked after all the widgets were filled.

If it returns None, the was_changed in fill() does not change. If it returns a boolean, that boolean will be returned as was_changed.

Parameters

was_changebool signalizing whether the fill() changed anything,

class schedule(parent, logger=None, **kwargs)

Base view for Satellite pages

class WeeklyPeriodForm(parent, logger=None, **kwargs)

View is a kind of abstract widget that can hold another widgets. Remembers the order, so therefore it can function like a form with defined filling order.

It looks like this:

class Login(View):
    user = SomeInputWidget('user')
    password = SomeInputWidget('pass')
    login = SomeButtonWidget('Log In')

    def a_method(self):
        do_something()

The view is usually instantiated with an instance of widgetastic.browser.Browser, which will then enable resolving of all of the widgets defined.

Parameters
  • parent – A parent View or widgetastic.browser.Browser

  • additional_context – If the view needs some context, for example - you want to check that you are on the page of user XYZ but you can also be on the page for user FOO, then you shall use the additional_context to pass in required variables that will allow you to detect this.

weekday
class MonthlyPeriodForm(parent, logger=None, **kwargs)

View is a kind of abstract widget that can hold another widgets. Remembers the order, so therefore it can function like a form with defined filling order.

It looks like this:

class Login(View):
    user = SomeInputWidget('user')
    password = SomeInputWidget('pass')
    login = SomeButtonWidget('Log In')

    def a_method(self):
        do_something()

The view is usually instantiated with an instance of widgetastic.browser.Browser, which will then enable resolving of all of the widgets defined.

Parameters
  • parent – A parent View or widgetastic.browser.Browser

  • additional_context – If the view needs some context, for example - you want to check that you are on the page of user XYZ but you can also be on the page for user FOO, then you shall use the additional_context to pass in required variables that will allow you to detect this.

day_of_month
class CustomPeriodForm(parent, logger=None, **kwargs)

View is a kind of abstract widget that can hold another widgets. Remembers the order, so therefore it can function like a form with defined filling order.

It looks like this:

class Login(View):
    user = SomeInputWidget('user')
    password = SomeInputWidget('pass')
    login = SomeButtonWidget('Log In')

    def a_method(self):
        do_something()

The view is usually instantiated with an instance of widgetastic.browser.Browser, which will then enable resolving of all of the widgets defined.

Parameters
  • parent – A parent View or widgetastic.browser.Browser

  • additional_context – If the view needs some context, for example - you want to check that you are on the page of user XYZ but you can also be on the page for user FOO, then you shall use the additional_context to pass in required variables that will allow you to detect this.

cron_line
next_step
period
period_selection
after_fill(was_change)

A hook invoked after all the widgets were filled.

If it returns None, the was_changed in fill() does not change. If it returns a boolean, that boolean will be returned as was_changed.

Parameters

was_changebool signalizing whether the fill() changed anything,

class locations(parent, logger=None, **kwargs)

Base view for Satellite pages

next_step
resources
after_fill(was_change)

A hook invoked after all the widgets were filled.

If it returns None, the was_changed in fill() does not change. If it returns a boolean, that boolean will be returned as was_changed.

Parameters

was_changebool signalizing whether the fill() changed anything,

class organizations(parent, logger=None, **kwargs)

Base view for Satellite pages

next_step
resources
after_fill(was_change)

A hook invoked after all the widgets were filled.

If it returns None, the was_changed in fill() does not change. If it returns a boolean, that boolean will be returned as was_changed.

Parameters

was_changebool signalizing whether the fill() changed anything,

class host_group(parent, logger=None, **kwargs)

Base view for Satellite pages

TAB_NAME = Host Groups
submit
resources
breadcrumb
fill(values)

overrides fill method, to be able to click next button during the creation process even, if no location or organization was selected, by adding the SCAP policy to Default Location or Organization.

property is_displayed

Overrides the Widget.is_displayed(). The difference is that if the view does not have the root locator, it assumes it is displayed.

Returns

bool

class airgun.views.oscappolicy.SCAPPolicyEditView(parent, logger=None, **kwargs)

Base view for Satellite pages

class deployment_options(parent, logger=None, **kwargs)

Base view for Satellite pages

next_step
deploy_by
class general(parent, logger=None, **kwargs)

Regular primary level Tab.

Usage:

@View.nested
class mytab(SatTab):
    TAB_NAME = 'My Tab'
@View.nested
class subscriptions(SatTab):
    # no need to specify 'TAB_NAME', it will be set to 'Subscriptions'
    # automatically
    pass

Note that TAB_NAME is optional and if it’s absent - capitalized class name is used instead, which is useful for simple tab names like ‘Subscriptions’

name
description
class scap_content(parent, logger=None, **kwargs)

Regular primary level Tab.

Usage:

@View.nested
class mytab(SatTab):
    TAB_NAME = 'My Tab'
@View.nested
class subscriptions(SatTab):
    # no need to specify 'TAB_NAME', it will be set to 'Subscriptions'
    # automatically
    pass

Note that TAB_NAME is optional and if it’s absent - capitalized class name is used instead, which is useful for simple tab names like ‘Subscriptions’

TAB_NAME = SCAP Content
scap_content
xccdf_profile
tailoring_file
xccdf_profile_tailoring_file
class schedule(parent, logger=None, **kwargs)

Regular primary level Tab.

Usage:

@View.nested
class mytab(SatTab):
    TAB_NAME = 'My Tab'
@View.nested
class subscriptions(SatTab):
    # no need to specify 'TAB_NAME', it will be set to 'Subscriptions'
    # automatically
    pass

Note that TAB_NAME is optional and if it’s absent - capitalized class name is used instead, which is useful for simple tab names like ‘Subscriptions’

class WeeklyPeriodForm(parent, logger=None, **kwargs)

View is a kind of abstract widget that can hold another widgets. Remembers the order, so therefore it can function like a form with defined filling order.

It looks like this:

class Login(View):
    user = SomeInputWidget('user')
    password = SomeInputWidget('pass')
    login = SomeButtonWidget('Log In')

    def a_method(self):
        do_something()

The view is usually instantiated with an instance of widgetastic.browser.Browser, which will then enable resolving of all of the widgets defined.

Parameters
  • parent – A parent View or widgetastic.browser.Browser

  • additional_context – If the view needs some context, for example - you want to check that you are on the page of user XYZ but you can also be on the page for user FOO, then you shall use the additional_context to pass in required variables that will allow you to detect this.

weekday
class MonthlyPeriodForm(parent, logger=None, **kwargs)

View is a kind of abstract widget that can hold another widgets. Remembers the order, so therefore it can function like a form with defined filling order.

It looks like this:

class Login(View):
    user = SomeInputWidget('user')
    password = SomeInputWidget('pass')
    login = SomeButtonWidget('Log In')

    def a_method(self):
        do_something()

The view is usually instantiated with an instance of widgetastic.browser.Browser, which will then enable resolving of all of the widgets defined.

Parameters
  • parent – A parent View or widgetastic.browser.Browser

  • additional_context – If the view needs some context, for example - you want to check that you are on the page of user XYZ but you can also be on the page for user FOO, then you shall use the additional_context to pass in required variables that will allow you to detect this.

day_of_month
class CustomPeriodForm(parent, logger=None, **kwargs)

View is a kind of abstract widget that can hold another widgets. Remembers the order, so therefore it can function like a form with defined filling order.

It looks like this:

class Login(View):
    user = SomeInputWidget('user')
    password = SomeInputWidget('pass')
    login = SomeButtonWidget('Log In')

    def a_method(self):
        do_something()

The view is usually instantiated with an instance of widgetastic.browser.Browser, which will then enable resolving of all of the widgets defined.

Parameters
  • parent – A parent View or widgetastic.browser.Browser

  • additional_context – If the view needs some context, for example - you want to check that you are on the page of user XYZ but you can also be on the page for user FOO, then you shall use the additional_context to pass in required variables that will allow you to detect this.

cron_line
period
period_selection
class locations(parent, logger=None, **kwargs)

Regular primary level Tab.

Usage:

@View.nested
class mytab(SatTab):
    TAB_NAME = 'My Tab'
@View.nested
class subscriptions(SatTab):
    # no need to specify 'TAB_NAME', it will be set to 'Subscriptions'
    # automatically
    pass

Note that TAB_NAME is optional and if it’s absent - capitalized class name is used instead, which is useful for simple tab names like ‘Subscriptions’

resources
class organizations(parent, logger=None, **kwargs)

Regular primary level Tab.

Usage:

@View.nested
class mytab(SatTab):
    TAB_NAME = 'My Tab'
@View.nested
class subscriptions(SatTab):
    # no need to specify 'TAB_NAME', it will be set to 'Subscriptions'
    # automatically
    pass

Note that TAB_NAME is optional and if it’s absent - capitalized class name is used instead, which is useful for simple tab names like ‘Subscriptions’

resources
class host_group(parent, logger=None, **kwargs)

Regular primary level Tab.

Usage:

@View.nested
class mytab(SatTab):
    TAB_NAME = 'My Tab'
@View.nested
class subscriptions(SatTab):
    # no need to specify 'TAB_NAME', it will be set to 'Subscriptions'
    # automatically
    pass

Note that TAB_NAME is optional and if it’s absent - capitalized class name is used instead, which is useful for simple tab names like ‘Subscriptions’

TAB_NAME = Host Groups
resources
submit
cancel
breadcrumb
property is_displayed

Overrides the Widget.is_displayed(). The difference is that if the view does not have the root locator, it assumes it is displayed.

Returns

bool

class airgun.views.oscappolicy.SCAPPolicyDetailsView(parent, logger=None, **kwargs)

Base view for Satellite pages

class HostsBreakdownStatus(parent, logger=None, **kwargs)

View is a kind of abstract widget that can hold another widgets. Remembers the order, so therefore it can function like a form with defined filling order.

It looks like this:

class Login(View):
    user = SomeInputWidget('user')
    password = SomeInputWidget('pass')
    login = SomeButtonWidget('Log In')

    def a_method(self):
        do_something()

The view is usually instantiated with an instance of widgetastic.browser.Browser, which will then enable resolving of all of the widgets defined.

Parameters
  • parent – A parent View or widgetastic.browser.Browser

  • additional_context – If the view needs some context, for example - you want to check that you are on the page of user XYZ but you can also be on the page for user FOO, then you shall use the additional_context to pass in required variables that will allow you to detect this.

ROOT = .//li[@data-name='Status table']
status_list
total_count
class HostBreakdownChart(parent, logger=None, **kwargs)

Refer to information from the middle of the chart in Oscap Policy Details View

hosts_breakdown
title
property is_displayed

Overrides the Widget.is_displayed(). The difference is that if the view does not have the root locator, it assumes it is displayed.

Returns

bool