Skip to content

Commit

Permalink
Merge pull request #47 from vexxhost/fix-superlint
Browse files Browse the repository at this point in the history
[WIP] Update superlint version
  • Loading branch information
okozachenko1203 authored May 16, 2022
2 parents 3b2f354 + 4aa8929 commit 34da944
Show file tree
Hide file tree
Showing 40 changed files with 456 additions and 413 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/linters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: github/super-linter@v3
- uses: github/super-linter@v4
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

VALIDATE_ALL_CODEBASE: true
VALIDATE_PYTHON_MYPY: false
VALIDATE_JSCPD: false
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ File-level backup will not be provided. The volume can be restored and attached

### Function Overview

The solution backs up all volumes attached to VMs which have a pre-defined metadata set, for
The solution backs up all volumes attached to VMs which have a predefined metadata set, for
example, `backup=yes`.
First, it gets the list of VMs which have backup metadata and the list of volumes attached to the
VMs in the given project by consuming the Openstack API (nova-api and cinder-api). Once the
Expand Down
43 changes: 22 additions & 21 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,33 @@
import os
import sys

sys.path.insert(0, os.path.abspath('../..'))
sys.path.insert(0, os.path.abspath("../.."))
# -- General configuration ----------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autodoc',
'openstackdocstheme',
#'sphinx.ext.intersphinx',
]
extensions = ["sphinx.ext.autodoc", "openstackdocstheme"]

# autodoc generation is a bit aggressive and a nuisance when doing heavy
# text edit cycles.
# execute "export SPHINX_DEBUG=1" in your terminal to disable

# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = u'staffeln'
copyright = u'2017, OpenStack Developers'
project = "staffeln"
copyright = "2017, OpenStack Developers"

# openstackdocstheme options
openstackdocs_repo_name = 'openstack/staffeln'
openstackdocs_bug_project = 'replace with the name of the project on Launchpad or the ID from Storyboard'
openstackdocs_bug_tag = ''
openstackdocs_repo_name = "openstack/staffeln"
openstackdocs_bug_project = (
"replace with the name of the project on Launchpad or the ID from Storyboard"
)
openstackdocs_bug_tag = ""

# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True
Expand All @@ -53,7 +51,7 @@
add_module_names = True

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'native'
pygments_style = "native"

# -- Options for HTML output --------------------------------------------------

Expand All @@ -62,20 +60,23 @@
# html_theme_path = ["."]
# html_theme = '_theme'
# html_static_path = ['static']
html_theme = 'openstackdocs'
html_theme = "openstackdocs"

# Output file base name for HTML help builder.
htmlhelp_basename = '%sdoc' % project
htmlhelp_basename = "%sdoc" % project

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass
# [howto/manual]).
latex_documents = [
('index',
'%s.tex' % project,
u'%s Documentation' % project,
u'OpenStack Developers', 'manual'),
(
"index",
"%s.tex" % project,
"%s Documentation" % project,
"OpenStack Developers",
"manual",
),
]

# Example configuration for intersphinx: refer to the Python standard library.
#intersphinx_mapping = {'http://docs.python.org/': None}
# intersphinx_mapping = {'http://docs.python.org/': None}
70 changes: 40 additions & 30 deletions releasenotes/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,42 +35,42 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'openstackdocstheme',
'reno.sphinxext',
"openstackdocstheme",
"reno.sphinxext",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"

# The encoding of source files.
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = u'staffeln Release Notes'
copyright = u'2017, OpenStack Developers'
project = "staffeln Release Notes"
copyright = "2017, OpenStack Developers"

# openstackdocstheme options
openstackdocs_repo_name = 'openstack/staffeln'
openstackdocs_repo_name = "openstack/staffeln"
openstackdocs_bug_project = """replace with the name of the
project on Launchpad or the ID from Storyboard"""
openstackdocs_bug_tag = ''
openstackdocs_auto_name = 'False'
openstackdocs_bug_tag = ""
openstackdocs_auto_name = "False"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
# The full version, including alpha/beta/rc tags.
release = ''
release = ""
# The short X.Y version.
version = ''
version = ""

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -102,7 +102,7 @@
# show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'native'
pygments_style = "native"

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
Expand All @@ -115,7 +115,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'openstackdocs'
html_theme = "openstackdocs"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down Expand Up @@ -144,7 +144,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down Expand Up @@ -189,18 +189,16 @@
# html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'staffelnReleaseNotesdoc'
htmlhelp_basename = "staffelnReleaseNotesdoc"


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
# 'preamble': '',
}
Expand All @@ -209,9 +207,13 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'staffelnReleaseNotes.tex',
u'staffeln Release Notes Documentation',
u'OpenStack Foundation', 'manual'),
(
"index",
"staffelnReleaseNotes.tex",
"staffeln Release Notes Documentation",
"OpenStack Foundation",
"manual",
),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -240,9 +242,13 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'staffelnrereleasenotes',
u'staffeln Release Notes Documentation',
[u'OpenStack Foundation'], 1)
(
"index",
"staffelnrereleasenotes",
"staffeln Release Notes Documentation",
["OpenStack Foundation"],
1,
)
]

# If true, show URL addresses after external links.
Expand All @@ -255,11 +261,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'staffeln ReleaseNotes',
u'staffeln Release Notes Documentation',
u'OpenStack Foundation', 'staffelnReleaseNotes',
'One line description of project.',
'Miscellaneous'),
(
"index",
"staffeln ReleaseNotes",
"staffeln Release Notes Documentation",
"OpenStack Foundation",
"staffelnReleaseNotes",
"One line description of project.",
"Miscellaneous",
),
]

# Documents to append as an appendix to all manuals.
Expand All @@ -275,4 +285,4 @@
# texinfo_no_detailmenu = False

# -- Options for Internationalization output ------------------------------
locale_dirs = ['locale/']
locale_dirs = ["locale/"]
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
import setuptools

setuptools.setup(
setup_requires=['pbr'],
pbr=True)
setuptools.setup(setup_requires=["pbr"], pbr=True)
4 changes: 1 addition & 3 deletions staffeln/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@

import pbr.version


__version__ = pbr.version.VersionInfo(
'staffeln').version_string()
__version__ = pbr.version.VersionInfo("staffeln").version_string()
13 changes: 6 additions & 7 deletions staffeln/api/app.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from flask import Flask
from flask import Response
from flask import request
from flask import Flask, Response, request
from oslo_log import log
from staffeln import objects
from staffeln.common import context
from oslo_log import log


ctx = context.make_context()
app = Flask(__name__)
Expand All @@ -14,15 +11,17 @@

@app.route("/v1/backup", methods=["POST"])
def backup_id():

if "backup_id" not in request.args:
# Return error if the backup_id argument is not provided.
return Response(
"Error: backup_id is missing.", status=403, mimetype="text/plain"
)

# Retrive the backup object from backup_data table with matching backup_id.
backup = objects.Volume.get_backup_by_backup_id(ctx, request.args["backup_id"])
backup = objects.Volume.get_backup_by_backup_id( # pylint: disable=E1120
context=ctx, backup_id=request.args["backup_id"]
)
# backup_info is None when there is no entry of the backup id in backup_table.
# So the backup should not be the automated backup.
if backup is None:
Expand Down
Loading

0 comments on commit 34da944

Please sign in to comment.