Initial import

This commit is contained in:
Artem Goncharov 2022-08-18 18:51:19 +02:00
commit f1321faef0
43 changed files with 1956 additions and 0 deletions

6
.coveragerc Normal file
View File

@ -0,0 +1,6 @@
[run]
branch = True
source = otc-metadata
[report]
ignore_errors = True

61
.gitignore vendored Normal file
View File

@ -0,0 +1,61 @@
# Add patterns in here to exclude files created by tools integrated with this
# repository, such as test frameworks from the project's recommended workflow,
# rendered documentation and package builds.
#
# Don't add patterns to exclude files created by preferred personal tools
# (editors, IDEs, your operating system itself even). These should instead be
# maintained outside the repository, for example in a ~/.gitignore file added
# with:
#
# git config --global core.excludesfile '~/.gitignore'
# Bytecompiled Python
*.py[cod]
# C extensions
*.so
# Packages
*.egg*
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
# Installer logs
pip-log.txt
# Unit test / coverage reports
cover/
.coverage*
!.coveragerc
.tox
nosetests.xml
.testrepository
.stestr
.venv
# Translations
*.mo
# Complexity
output/*.html
output/*/index.html
# Sphinx
doc/build
# pbr generates these
AUTHORS
ChangeLog
# Files created by releasenotes build
releasenotes/build

4
.gitreview Normal file
View File

@ -0,0 +1,4 @@
[gerrit]
host=review.opendev.org
port=29418
project=infra/ssh://git@gitea.eco.tsi-dev.otc-service.com:2222/infra/otc-metadata.git.git

3
.mailmap Normal file
View File

@ -0,0 +1,3 @@
# Format is:
# <preferred e-mail> <other e-mail 1>
# <preferred e-mail> <other e-mail 2>

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=./otc-metadata/tests
top_dir=./

3
CONTRIBUTING.rst Normal file
View File

@ -0,0 +1,3 @@
The source repository for this project can be found at:
https://github.com/infra/ssh://git@gitea.eco.tsi-dev.otc-service.com:2222/infra/otc-metadata.git

4
HACKING.rst Normal file
View File

@ -0,0 +1,4 @@
ssh://git@gitea.eco.tsi-dev.otc-service.com:2222/infra/otc-metadata.git Style Commandments
===============================================
Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/

176
LICENSE Normal file

File diff suppressed because it is too large Load Diff

18
README.rst Normal file
View File

@ -0,0 +1,18 @@
===============================
ssh://git@gitea.eco.tsi-dev.otc-service.com:2222/infra/otc-metadata.git
===============================
Metadata about OTC for Ecosystem
Please fill here a long description which must be at least 3 lines wrapped on
80 cols, so that distribution package maintainers can use it in their packages.
Note that this is a hard requirement.
* Free software: Apache license
* Documentation: https://docs.otc.t-systems.com/ssh://git@gitea.eco.tsi-dev.otc-service.com:2222/infra/otc-metadata.git
* Source: https://github.com/infra/ssh://git@gitea.eco.tsi-dev.otc-service.com:2222/infra/otc-metadata.git
Features
--------
* TODO

4
doc/requirements.txt Normal file
View File

@ -0,0 +1,4 @@
sphinx>=2.0.0,!=2.1.0 # BSD
otcdocstheme>=1.0.0 # Apache-2.0
# releasenotes
reno>=3.1.0 # Apache-2.0

View File

@ -0,0 +1,5 @@
====================
Administrators guide
====================
Administrators guide of ssh://git@gitea.eco.tsi-dev.otc-service.com:2222/infra/otc-metadata.git.

5
doc/source/cli/index.rst Normal file
View File

@ -0,0 +1,5 @@
================================
Command line interface reference
================================
CLI reference of ssh://git@gitea.eco.tsi-dev.otc-service.com:2222/infra/otc-metadata.git.

76
doc/source/conf.py Executable file
View File

@ -0,0 +1,76 @@
# -*- coding: utf-8 -*-
# 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.
import os
import sys
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',
'otcdocstheme',
#'sphinx.ext.intersphinx',
]
# 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'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'ssh://git@gitea.eco.tsi-dev.otc-service.com:2222/infra/otc-metadata.git'
copyright = '2022, Open Telekom Cloud Developers'
# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
add_module_names = True
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'native'
# -- Options for HTML output --------------------------------------------------
# The theme to use for HTML and HTML Help pages. Major themes that come with
# Sphinx are currently 'default' and 'sphinxdoc'.
# html_theme_path = ["."]
# html_theme = '_theme'
# html_static_path = ['static']
html_theme = 'otcdocs'
# Output file base name for HTML help builder.
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,
'%s Documentation' % project,
'Open Telekom Cloud Developers', 'manual'),
]
# Example configuration for intersphinx: refer to the Python standard library.
#intersphinx_mapping = {'http://docs.python.org/': None}

View File

@ -0,0 +1,5 @@
=============
Configuration
=============
Configuration of ssh://git@gitea.eco.tsi-dev.otc-service.com:2222/infra/otc-metadata.git.

View File

@ -0,0 +1,5 @@
============================
So You Want to Contribute...
============================
TODO

View File

@ -0,0 +1,9 @@
===========================
Contributor Documentation
===========================
.. toctree::
:maxdepth: 2
contributing

30
doc/source/index.rst Normal file
View File

@ -0,0 +1,30 @@
.. ssh://git@gitea.eco.tsi-dev.otc-service.com:2222/infra/otc-metadata.git documentation master file, created by
sphinx-quickstart on Tue Jul 9 22:26:36 2013.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
============================================
Welcome to the documentation of otc-metadata
============================================
Contents:
.. toctree::
:maxdepth: 2
readme
install/index
library/index
contributor/index
configuration/index
cli/index
user/index
admin/index
reference/index
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

View File

@ -0,0 +1,14 @@
================================================
{{cookiecutter.module_name}} installation guide
================================================
.. toctree::
:maxdepth: 2
install.rst
The otc-metadata provides...
This chapter assumes a working setup of OpenStack following the
`OpenStack Installation Tutorial
<https://docs.openstack.org/project-install-guide/ocata/>`_.

View File

@ -0,0 +1,13 @@
.. _install:
Install and configure
~~~~~~~~~~~~~~~~~~~~~
This section describes how to install and configure the
otc-metadata.
This section assumes that you already have a working OpenStack
environment with at least the following components installed:
.. (add the appropriate services here and further notes)
Note that installation and configuration vary by distribution.

View File

@ -0,0 +1,7 @@
========
Usage
========
To use ssh://git@gitea.eco.tsi-dev.otc-service.com:2222/infra/otc-metadata.git in a project::
import otc-metadata

1
doc/source/readme.rst Normal file
View File

@ -0,0 +1 @@
.. include:: ../../README.rst

View File

@ -0,0 +1,5 @@
==========
References
==========
References of ssh://git@gitea.eco.tsi-dev.otc-service.com:2222/infra/otc-metadata.git.

View File

@ -0,0 +1,5 @@
===========
Users guide
===========
Users guide of ssh://git@gitea.eco.tsi-dev.otc-service.com:2222/infra/otc-metadata.git.

35
otc_metadata/__init__.py Normal file
View File

@ -0,0 +1,35 @@
# 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.
__all__ = ['__version__', 'Docs']
import pbr.version
from otc_metadata.services import Services # flake8: noqa
__version__ = pbr.version.VersionInfo('otc-metadata').version_string()
_service_manager = None
def get_service_data(*args, **kwargs):
"""Return singleton instance of the Services object.
Parameters are all passed through to the
:class:`~otc_metadata.services.Services` constructor.
.. note::
Only one singleton is kept, so if instances with different parameter
values are desired, directly calling the constructor is necessary.
:returns: Singleton instance of
:class:`~otc_metadata.services.Services`
"""
global _service_manager
if not _service_manager:
_service_manager = Services(*args, **kwargs)
return _service_manager

View File

@ -0,0 +1,29 @@
# 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.
import os
import yaml
__all__ = ['read_data']
DATA_DIR = os.path.dirname(__file__)
def read_data(filename):
"""Return data that is shipped inside the Python package.
"""
filepath = os.path.join(DATA_DIR, filename)
with open(filepath, 'r') as fd:
return yaml.safe_load(fd)

File diff suppressed because it is too large Load Diff

38
otc_metadata/docs.py Normal file
View File

@ -0,0 +1,38 @@
# 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.
import copy
import otc_metadata.data
__all__ = ['Docs']
BUILTIN_DATA = otc_metadata.data.read_data('docs.yaml')
def _normalize_type(service_type):
if service_type:
return service_type.replace('_', '-')
class Service(object):
"""Encapsulation of the OTC Docs data
"""
def __init__(self):
self._service_data = BUILTIN_DATA
@property
def all_services(self):
"Service Categories data listing."
return copy.deepcopy(self._service_data['services'])

47
otc_metadata/services.py Normal file
View File

@ -0,0 +1,47 @@
# 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.
import copy
import otc_metadata.data
__all__ = ['Services']
BUILTIN_DATA = otc_metadata.data.read_data('services.yaml')
def _normalize_type(service_type):
if service_type:
return service_type.replace('_', '-')
class Services(object):
"""Encapsulation of the OTC Services data
"""
def __init__(self):
self._service_data = BUILTIN_DATA
@property
def all_services(self):
"Service Categories data listing."
return copy.deepcopy(self._service_data['services'])
def services_by_category(self, category):
"""List services matching category
"""
res = []
for srv in self.all_services:
if srv['service_category'] == category:
res.append(copy.deepcopy(srv))
return res

View File

View File

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# Copyright 2010-2011 OpenStack Foundation
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# 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 unittest import TestCase
class TestCase(TestCase):
"""Test case base class for all unit tests."""

View File

@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
# 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.
"""
test_otc-metadata
----------------------------------
Tests for `otc-metadata` module.
"""
from otc-metadata.tests import base
class TestOtc-metadata(base.TestCase):
def test_something(self):
pass

View File

View File

271
releasenotes/source/conf.py Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
============================================
otc-metadata Release Notes
============================================
.. toctree::
:maxdepth: 1
unreleased

View File

@ -0,0 +1,5 @@
==============================
Current Series Release Notes
==============================
.. release-notes::

5
requirements.txt Normal file
View File

@ -0,0 +1,5 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
pbr>=2.0 # Apache-2.0

25
setup.cfg Normal file
View File

@ -0,0 +1,25 @@
[metadata]
name = ssh://git@gitea.eco.tsi-dev.otc-service.com:2222/infra/otc-metadata.git
summary = Metadata about OTC for Ecosystem
description-file =
README.rst
author = Open Telekom Cloud
home-page = https://open.telekom.cloud/
python-requires = >=3.6
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology
Intended Audience :: System Administrators
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: Implementation :: CPython
[files]
packages =
otc_metadata

19
setup.py Normal file
View File

@ -0,0 +1,19 @@
# 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.
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
import setuptools
setuptools.setup(
setup_requires=['pbr'],
pbr=True)

10
test-requirements.txt Normal file
View File

@ -0,0 +1,10 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking>=3.0,<3.1 # Apache-2.0
coverage>=4.0,!=4.4 # Apache-2.0
python-subunit>=0.0.18 # Apache-2.0/BSD
stestr>=1.0.0 # Apache-2.0
testtools>=1.4.0 # MIT

56
tox.ini Normal file
View File

@ -0,0 +1,56 @@
[tox]
minversion = 3.2.0
envlist = py39,pep8
skipsdist = True
ignore_basepython_conflict = true
[testenv]
basepython = python3
usedevelop = True
setenv =
PYTHONWARNINGS=default::DeprecationWarning
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60
deps = -r{toxinidir}/test-requirements.txt
commands = stestr run {posargs}
[testenv:lower-constraints]
deps = -r{toxinidir}/test-requirements.txt
[testenv:pep8]
commands = flake8 {posargs}
[testenv:venv]
commands = {posargs}
[testenv:cover]
setenv =
VIRTUAL_ENV={envdir}
PYTHON=coverage run --source otc_metadata --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:releasenotes]
deps = {[testenv:docs]deps}
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:debug]
commands = oslo_debug_helper {posargs}
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
show-source = True
ignore = E123,E125
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build

19
zuul.yaml Normal file
View File

@ -0,0 +1,19 @@
- project:
merge-mode: squash-merge
default-branch: master
templates:
- publish-to-pypi
- publish-otc-docs-hc-pti
- release-notes-jobs
check:
jobs:
- otc-tox-pep8
- otc-tox-py38
- otc-tox-py39
- tox-functional
gate:
jobs:
- otc-tox-pep8
- otc-tox-py38
- otc-tox-py39
- tox-functional