diff --git a/horizon/exceptions.py b/horizon/exceptions.py index 76fbf24106..c1c5157fff 100644 --- a/horizon/exceptions.py +++ b/horizon/exceptions.py @@ -287,7 +287,7 @@ def handle(request, message=None, redirect=None, ignore=False, a redirect value may be passed to the error handler so users are returned to a different view than the one requested in addition to the error message. - #. RECOVERABLE: Generic API errors which generate a user-facing message + #. ``RECOVERABLE``: Generic API errors which generate a user-facing message but drop directly back to the regular code flow. All other exceptions bubble the stack as normal unless the ``ignore`` diff --git a/horizon/middleware/operation_log.py b/horizon/middleware/operation_log.py index 8c93495b75..225c864831 100644 --- a/horizon/middleware/operation_log.py +++ b/horizon/middleware/operation_log.py @@ -27,14 +27,23 @@ LOG = logging.getLogger(__name__) class OperationLogMiddleware(object): """Middleware to output operation log. - This log can includes information below. - , - , - , - , , - , , - - And log format is defined OPERATION_LOG_OPTIONS. + This log can includes information below: + + - ``domain name`` + - ``domain id`` + - ``project name`` + - ``project id`` + - ``user name`` + - ``user id`` + - ``request scheme`` + - ``referer url`` + - ``request url`` + - ``message`` + - ``method`` + - ``http status`` + - ``request parameters`` + + and log format is defined OPERATION_LOG_OPTIONS. """ @property diff --git a/horizon/tables/base.py b/horizon/tables/base.py index 1bdb1df4ca..675f2e38a3 100644 --- a/horizon/tables/base.py +++ b/horizon/tables/base.py @@ -899,7 +899,7 @@ class DataTableOptions(object): Boolean value to control the display of the "filter" search box in the table actions. By default it checks whether or not an instance - of :class:`.FilterAction` is in :attr:`.table_actions`. + of :class:`.FilterAction` is in ``table_actions``. .. attribute:: template diff --git a/horizon/tables/views.py b/horizon/tables/views.py index 4e1b392809..9c68012e23 100644 --- a/horizon/tables/views.py +++ b/horizon/tables/views.py @@ -284,10 +284,11 @@ class DataTableView(MultiTableView): def get_filters(self, filters=None, filters_map=None): """Converts a string given by the user into a valid api filter value. + :filters: Default filter values. - {'filter1': filter_value, 'filter2': filter_value} + {'filter1': filter_value, 'filter2': filter_value} :filters_map: mapping between user input and valid api filter values. - {'filter_name':{_("true_value"):True, _("false_value"):False} + {'filter_name':{_("true_value"):True, _("false_value"):False} """ filters = filters or {} filters_map = filters_map or {} diff --git a/horizon/templatetags/horizon.py b/horizon/templatetags/horizon.py index d13b1165ac..9768bdaa88 100644 --- a/horizon/templatetags/horizon.py +++ b/horizon/templatetags/horizon.py @@ -218,9 +218,12 @@ def template_cache_age(): @register.tag def minifyspace(parser, token): - """Removes whitespace including tab and newline characters. Do not use this - if you are using a
 tag
+    """Removes whitespace including tab and newline characters.
+
+    Do not use this if you are using a 
 tag.
+
     Example usage::
+
         {% minifyspace %}
             

{% endminifyspace %} + This example would return this HTML:: +

Foo

+ """ nodelist = parser.parse(('endminifyspace',)) parser.delete_first_token() diff --git a/horizon/test/firefox_binary.py b/horizon/test/firefox_binary.py index 93cb955914..c836b5e0ff 100644 --- a/horizon/test/firefox_binary.py +++ b/horizon/test/firefox_binary.py @@ -31,10 +31,10 @@ class FirefoxBinary(firefox.firefox_binary.FirefoxBinary): cause hasn't been properly diagnosed yet but it's around: - getting a free port from the OS with - selenium.webdriver.common.utils free_port(), + selenium.webdriver.common.utils free_port(), - release the port immediately but record it in ff prefs so that ff - can listen on that port for the internal http server. + can listen on that port for the internal http server. It has been observed that this leads to hanging processes for 'firefox -silent'. diff --git a/horizon/test/test_hacking.py b/horizon/test/test_hacking.py index 32b9fd0ac7..451b80ac79 100644 --- a/horizon/test/test_hacking.py +++ b/horizon/test/test_hacking.py @@ -25,23 +25,49 @@ class HackingTestCase(helpers.TestCase): strings to the check methods like the pep8/flake8 parser would. The parser loops over each line in the file and then passes the parameters to the check method. The parameter names in the check method dictate what type of - object is passed to the check method. The parameter types are:: - logical_line: A processed line with the following modifications: - - Multi-line statements converted to a single line. - - Stripped left and right. - - Contents of strings replaced with "xxx" of same length. - - Comments removed. - physical_line: Raw line of text from the input file. - lines: a list of the raw lines from the input file - tokens: the tokens that contribute to this logical line - line_number: line number in the input file - total_lines: number of lines in the input file - blank_lines: blank lines before this one - indent_char: indentation character in this file (" " or "\t") - indent_level: indentation (with tabs expanded to multiples of 8) - previous_indent_level: indentation on previous line - previous_logical: previous logical line - filename: Path of the file being run through pep8 + object is passed to the check method. The parameter types are: + + logical_line + A processed line with the following modifications: + + - Multi-line statements converted to a single line. + - Stripped left and right. + - Contents of strings replaced with "xxx" of same length. + - Comments removed. + + physical_line + Raw line of text from the input file. + + lines + a list of the raw lines from the input file + + tokens + the tokens that contribute to this logical line + + line_number + line number in the input file + + total_lines + number of lines in the input file + + blank_lines + blank lines before this one + + indent_char + indentation character in this file (" " or "\t") + + indent_level + indentation (with tabs expanded to multiples of 8) + + previous_indent_level + indentation on previous line + + previous_logical + previous logical line + + filename + Path of the file being run through pep8 + When running a test on a check method the return will be False/None if there is no violation in the sample input. If there is an error a tuple is returned with a position in the line, and a message. So to check the result diff --git a/horizon/utils/memoized.py b/horizon/utils/memoized.py index 607acebf71..218fd38ccd 100644 --- a/horizon/utils/memoized.py +++ b/horizon/utils/memoized.py @@ -132,7 +132,7 @@ def memoized_with_request(request_func, request_index=0): request, and thus the memoizing will operate just on that part of the request that is relevant to the function being memoized. - short example: + short example:: @memoized def _get_api_client(username, token_id, project_id, auth_url) diff --git a/horizon/workflows/base.py b/horizon/workflows/base.py index 5ef09a5c50..10117365cf 100644 --- a/horizon/workflows/base.py +++ b/horizon/workflows/base.py @@ -103,46 +103,51 @@ class Action(forms.Form): .. attribute:: name - The verbose name for this action. Defaults to the name of the class. + The verbose name for this action. Defaults to the name of the class. .. attribute:: slug - A semi-unique slug for this action. Defaults to the "slugified" name - of the class. + A semi-unique slug for this action. Defaults to the "slugified" name + of the class. .. attribute:: permissions - A list of permission names which this action requires in order to be - completed. Defaults to an empty list (``[]``). + A list of permission names which this action requires in order to be + completed. Defaults to an empty list (``[]``). .. attribute:: policy_rules - list of scope and rule tuples to do policy checks on, the - composition of which is (scope, rule) + list of scope and rule tuples to do policy checks on, the + composition of which is (scope, rule) - scope: service type managing the policy for action - rule: string representing the action to be checked + * scope: service type managing the policy for action + * rule: string representing the action to be checked - for a policy that requires a single rule check: - policy_rules should look like - "(("compute", "compute:create_instance"),)" - for a policy that requires multiple rule checks: - rules should look like - "(("identity", "identity:list_users"), - ("identity", "identity:list_roles"))" - where two service-rule clauses are OR-ed. + for a policy that requires a single rule check:: + + policy_rules should look like + "(("compute", "compute:create_instance"),)" + + for a policy that requires multiple rule checks:: + + rules should look like + "(("identity", "identity:list_users"), + ("identity", "identity:list_roles"))" + + where two service-rule clauses are OR-ed. .. attribute:: help_text - A string of simple help text to be displayed alongside the Action's - fields. + A string of simple help text to be displayed alongside the Action's + fields. .. attribute:: help_text_template - A path to a template which contains more complex help text to be - displayed alongside the Action's fields. In conjunction with - :meth:`~horizon.workflows.Action.get_help_text` method you can - customize your help text template to display practically anything. + A path to a template which contains more complex help text to be + displayed alongside the Action's fields. In conjunction with + :meth:`~horizon.workflows.Action.get_help_text` method you can + customize your help text template to display practically anything. + """ def __init__(self, request, context, *args, **kwargs): diff --git a/openstack_dashboard/api/glance.py b/openstack_dashboard/api/glance.py index 6627124b3a..6874d27301 100644 --- a/openstack_dashboard/api/glance.py +++ b/openstack_dashboard/api/glance.py @@ -233,39 +233,39 @@ def image_list_detailed(request, marker=None, sort_dir='desc', using the first object id on current page as the marker - restoring the original items ordering before sending them back to the UI. - .. param:: request + :param request: The request object coming from browser to be passed further into Glance service. - .. param:: marker + :param marker: The id of an object which defines a starting point of a query sent to Glance service. - .. param:: sort_dir + :param sort_dir: The direction by which the resulting image list throughout all pages (if pagination is enabled) will be sorted. Could be either 'asc' (ascending) or 'desc' (descending), defaults to 'desc'. - .. param:: sort_key + :param sort_key: The name of key by by which the resulting image list throughout all pages (if pagination is enabled) will be sorted. Defaults to 'created_at'. - .. param:: filters + :param filters: A dictionary of filters passed as is to Glance service. - .. param:: paginate + :param paginate: Whether the pagination is enabled. If it is, then the number of entries on a single page of images table is limited to the specific number stored in browser cookies. - .. param:: reversed_order + :param reversed_order: Set this flag to True when it's necessary to get a reversed list of images from Glance (used for navigating the images list back in UI). diff --git a/openstack_dashboard/api/rest/nova.py b/openstack_dashboard/api/rest/nova.py index 2227abcc48..0dae9b7eac 100644 --- a/openstack_dashboard/api/rest/nova.py +++ b/openstack_dashboard/api/rest/nova.py @@ -190,7 +190,7 @@ class Limits(generic.View): request: :param reserved: Take into account the reserved limits. Reserved limits - may be instances in the rebuild process for example. + may be instances in the rebuild process for example. The result is an object with limits as properties. """ diff --git a/openstack_dashboard/templatetags/context_selection.py b/openstack_dashboard/templatetags/context_selection.py index 90bf4707dc..3f5b5c3c62 100644 --- a/openstack_dashboard/templatetags/context_selection.py +++ b/openstack_dashboard/templatetags/context_selection.py @@ -117,9 +117,11 @@ def iframe_embed_settings(context): def get_project_name(project_id, projects): """Retrieves project name for given project id + Args: projects: List of projects project_id: project id + Returns: Project name or None if there is no match """ for project in projects: