Remove unecessary files
Change-Id: I38761dd7e93cf83b5c2df364b545a49603077074
This commit is contained in:
parent
bac30ca8a7
commit
c03eb9873e
@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="TestRunnerService">
|
||||
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
|
||||
</component>
|
||||
</module>
|
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6.0 (C:\Users\nv757p\vEnv-36\Scripts\python.exe)" project-jdk-type="Python SDK" />
|
||||
</project>
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/doc.iml" filepath="$PROJECT_DIR$/.idea/doc.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -1,250 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="c284aaf5-9cd1-41bb-acfb-a73c8e5a3cec" name="Default" comment="" />
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="TRACKING_ENABLED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="CreatePatchCommitExecutor">
|
||||
<option name="PATCH_PATH" value="" />
|
||||
</component>
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
|
||||
<component name="FileEditorManager">
|
||||
<leaf />
|
||||
</component>
|
||||
<component name="ProjectFrameBounds">
|
||||
<option name="x" value="722" />
|
||||
<option name="y" value="6" />
|
||||
<option name="width" value="1191" />
|
||||
<option name="height" value="1030" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator currentView="ProjectPane" proportions="" version="1">
|
||||
<flattenPackages />
|
||||
<showMembers />
|
||||
<showModules />
|
||||
<showLibraryContents />
|
||||
<hideEmptyPackages />
|
||||
<abbreviatePackageNames />
|
||||
<autoscrollToSource />
|
||||
<autoscrollFromSource />
|
||||
<sortByType />
|
||||
<manualOrder />
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="doc" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="doc" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="Scope" />
|
||||
<pane id="Scratches" />
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/../../hello_devstack" />
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<configuration default="true" type="PythonConfigurationType" factoryName="Python">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="doc" />
|
||||
<option name="SCRIPT_NAME" value="" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="Tox" factoryName="Tox">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="doc" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="tests" factoryName="Attests">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="doc" />
|
||||
<option name="SCRIPT_NAME" value="" />
|
||||
<option name="CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="FOLDER_NAME" value="" />
|
||||
<option name="TEST_TYPE" value="TEST_SCRIPT" />
|
||||
<option name="PATTERN" value="" />
|
||||
<option name="USE_PATTERN" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="tests" factoryName="Doctests">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="doc" />
|
||||
<option name="SCRIPT_NAME" value="" />
|
||||
<option name="CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="FOLDER_NAME" value="" />
|
||||
<option name="TEST_TYPE" value="TEST_SCRIPT" />
|
||||
<option name="PATTERN" value="" />
|
||||
<option name="USE_PATTERN" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="tests" factoryName="Nosetests">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="doc" />
|
||||
<option name="SCRIPT_NAME" value="" />
|
||||
<option name="CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="FOLDER_NAME" value="" />
|
||||
<option name="TEST_TYPE" value="TEST_SCRIPT" />
|
||||
<option name="PATTERN" value="" />
|
||||
<option name="USE_PATTERN" value="false" />
|
||||
<option name="PARAMS" value="" />
|
||||
<option name="USE_PARAM" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="tests" factoryName="Unittests">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="doc" />
|
||||
<option name="SCRIPT_NAME" value="" />
|
||||
<option name="CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="FOLDER_NAME" value="" />
|
||||
<option name="TEST_TYPE" value="TEST_SCRIPT" />
|
||||
<option name="PATTERN" value="" />
|
||||
<option name="USE_PATTERN" value="false" />
|
||||
<option name="PUREUNITTEST" value="true" />
|
||||
<option name="PARAMS" value="" />
|
||||
<option name="USE_PARAM" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="tests" factoryName="py.test">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="doc" />
|
||||
<option name="SCRIPT_NAME" value="" />
|
||||
<option name="CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="FOLDER_NAME" value="" />
|
||||
<option name="TEST_TYPE" value="TEST_SCRIPT" />
|
||||
<option name="PATTERN" value="" />
|
||||
<option name="USE_PATTERN" value="false" />
|
||||
<option name="testToRun" value="" />
|
||||
<option name="keywords" value="" />
|
||||
<option name="params" value="" />
|
||||
<option name="USE_PARAM" value="false" />
|
||||
<option name="USE_KEYWORD" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
||||
<component name="ShelveChangesManager" show_recycled="false">
|
||||
<option name="remove_strategy" value="false" />
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="c284aaf5-9cd1-41bb-acfb-a73c8e5a3cec" name="Default" comment="" />
|
||||
<created>1485886196137</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1485886196137</updated>
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="722" y="6" width="1191" height="1030" extended-state="0" />
|
||||
<editor active="false" />
|
||||
<layout>
|
||||
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24936171" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
</layout>
|
||||
</component>
|
||||
<component name="VcsContentAnnotationSettings">
|
||||
<option name="myLimit" value="2678400000" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager />
|
||||
<watches-manager />
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/ostro_listener1.rst">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="0">
|
||||
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
</project>
|
@ -1,8 +0,0 @@
|
||||
[run]
|
||||
branch = True
|
||||
source = valet
|
||||
omit = valet_plugins/tests/*
|
||||
cover_pylib = True
|
||||
|
||||
[report]
|
||||
ignore_errors = True
|
106
plugins/.gitignore
vendored
106
plugins/.gitignore
vendored
@ -1,106 +0,0 @@
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
|
||||
#ignore thumbnails created by windows
|
||||
Thumbs.db
|
||||
#Ignore files build by Visual Studio
|
||||
*.obj
|
||||
*.exe
|
||||
*.pdb
|
||||
*.user
|
||||
*.aps
|
||||
*.pch
|
||||
*.vspscc
|
||||
*_i.c
|
||||
*_p.c
|
||||
*.ncb
|
||||
*.suo
|
||||
*.tlb
|
||||
*.tlh
|
||||
*.bak
|
||||
*.cache
|
||||
*.ilk
|
||||
*.log
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
env/
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
*.egg-info/
|
||||
.eggs/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script from a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
*.manifest
|
||||
*.spec
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.coverage
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
.project
|
||||
.pydevproject
|
||||
.settings/
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
|
||||
# PyBuilder
|
||||
target/
|
||||
|
||||
#ignore thumbnails created by windows
|
||||
Thumbs.db
|
||||
#Ignore files build by Visual Studio
|
||||
*.obj
|
||||
*.exe
|
||||
*.pdb
|
||||
*.user
|
||||
*.aps
|
||||
*.pch
|
||||
*.vspscc
|
||||
*_i.c
|
||||
*_p.c
|
||||
*.ncb
|
||||
*.suo
|
||||
*.tlb
|
||||
*.tlh
|
||||
*.bak
|
||||
*.cache
|
||||
*.ilk
|
||||
[Bb]in
|
||||
[Dd]ebug*/
|
||||
*.lib
|
||||
*.sbr
|
||||
obj/
|
||||
[Rr]elease*/
|
||||
_ReSharper*/
|
||||
[Tt]est[Rr]esult*
|
||||
.idea/*
|
@ -1,4 +0,0 @@
|
||||
[gerrit]
|
||||
host=gerrit.mtn5.cci.att.com
|
||||
port=29418
|
||||
project=aic-valet-openstack-plugins.git
|
@ -1,7 +0,0 @@
|
||||
[DEFAULT]
|
||||
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
|
||||
OS_STDERR_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
|
||||
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-1000} \
|
||||
${PYTHON:-python} -m subunit.run discover ${OS_TEST_PATH:-./valet_plugins/tests/unit} -t . $LISTOPT $IDOPTION
|
||||
test_id_option=--load-list $IDFILE
|
||||
test_list_option=--list
|
176
plugins/LICENSE
176
plugins/LICENSE
@ -1,176 +0,0 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
@ -1,57 +0,0 @@
|
||||
Ostro version 2.0.2 Installation and Usage Guide
|
||||
|
||||
Author: Gueyoung Jung
|
||||
Contact: gjung@research.att.com
|
||||
|
||||
|
||||
INSTALLATION
|
||||
|
||||
You can download the latest Ostro python code from repository (CodeCloud).
|
||||
|
||||
USAGE
|
||||
|
||||
1. Configure Ostro
|
||||
|
||||
Set authentication in "ostro_server/ostro.auth" file. User must have the permission to access OpenStack Nova to let Ostro extract underlying cloud infrastructure information.
|
||||
|
||||
You must check “ostro_server/ostro.cfg” to correctly run Ostro. Here, explain the configuration parameters found in “ostro.cfg”.
|
||||
|
||||
Configuration consists of 1) system, 2) logging, and 3) management parts.
|
||||
|
||||
1.1 System configuration
|
||||
- first, you define the base directory in “root_loc”, where Ostro is installed.
|
||||
- “mode” can be either “live” or “sim”. “live” means Ostro runs over the real OpenStack site, while “sim” means Ostro can be tested over a simulated datacenter. To configure the simulated datacenter, you should check “ostro_server/ostro_sim.cfg”.
|
||||
- “control_loc” is to set URL where OpenStack controller is deployed. From the URL, Ostro will get some data from Nova and Keystone (Cinder will be in the next version).
|
||||
- currently, Ostro communicates with Keystone and Nova via REST APIs. Those APIs are set in “keystone_*” and “nova_*”.
|
||||
- “db_*” indicates parameters to be used for handling Music database such as Cassandra keyspace and table names. "replication_factor" means how many Music instances run. "db_hosts" includes the ips where Music instances run.
|
||||
- “ip” indicates the IP address of VM, where this Ostro instance runs. If Ostro instances are installed in multiple VMs, you should set “ip” in each configuration.
|
||||
|
||||
1.2 Logging configuration
|
||||
You can set up the logging configuration including logger name, logging level, and directory. If you set the logging level as “debug”, Ostro will leave detailed record. Ostro also records two time-series data as text files (i.e., resource_log and app_log). Due to the large size of these logs, we limit the number of log files and the maximum size of each log file in “max_num_of_logs” and “max_log_size”. When “max_num_of_logs” is 20 and once it reaches the 21st log file, Ostro over-writes in the 1st file (i.e., rotate the logging).
|
||||
"max_main_log_size" means the max size of the main Ostro log defined in "logger_name" in the location "logging_loc".
|
||||
|
||||
1.3 Management configuration
|
||||
- “datacenter_name” indicates the name of site (region), where Ostro takes care of. This will be used as key value when getting site topology data from AIC Formation.
|
||||
- “num_of_region_chars”, “rack_code_list”, and “node_code_list” are used to define the machine naming convention. In current version, Ostro parses each hosting server machine name to figure out the region code and rack name, where each hosting machine is located. This is based on the current naming convention document. Current naming convention is as follow,
|
||||
3 chars of CLLI + region number + 'r' + rack id number + 1 char of node type + node id number. For example, “pdk15r05c001” indicates the first KVM compute server (i.e., 'c001') in the fifth rack (i.e., 'r05') in the fifteenth DeKalb-Peachtree Airport Region (i.e., 'pdk15').
|
||||
In “num_of_region_chars”, set the number of chars that indicates the region code. In the above example, 'pdk' is the region code.
|
||||
In “rack_code_list”, set 1 char of rack indicator. This should be 'r'.
|
||||
In “node_code_list”, set all of chars, each of which indicates the node type. Currently, 'a': network, 'c': KVM compute, 'u': ESXi compute, 'f': ?, 'o': operation, 'p': power, 's': storage.
|
||||
- “compute_trigger_time” and “compute_trigger_frequency” are for setting when Nova is called to set information that is used for decision making such as a list of hosting servers and their resource capacities, host aggregates, and availability zone etc. The value of “compute_trigger_time” is based on 24-hour (e.g., “13:00” means 1pm). The value of “compute_trigger_frequency” is seconds (e.g., “3” means every 3 seconds). Ostro checks first “compute_trigger_frequency”. If this value is “0”, then uses “compute_trigger_time”.
|
||||
- “topology_trigger_time” and “topology_trigger_frequency” are similar with the above, but these are for setting the site layout/topology. Note that currently, Nova must be called first and then, topology next. So, “compute_trigger_time” must be earlier than “topology_trigger_time”.
|
||||
- “default_*” is for setting default overcommit ratios.
|
||||
- “static_*” is for setting standby resource amount as percentage. Standby means Ostro will set aside certain amount resources (CPU, memory, and disk) as unused for load spikes of tenant applications. This will be changed more dynamically in the future version.
|
||||
- “auth_loc” indicates the directory of the authentication file. Admin must have the permission to access OpenStack Nova to let Ostro extract underlying cloud infrastructure information.
|
||||
|
||||
|
||||
2. Start/Stop Ostro daemon
|
||||
|
||||
Ostro will run as a daemon process. Go to “ostro_server” directory, then start Ostro daemon as follow,
|
||||
|
||||
python ostro_daemon.py start
|
||||
|
||||
To stop this daemon process:
|
||||
|
||||
python ostro_daemon.py stop
|
||||
|
||||
|
@ -1,34 +0,0 @@
|
||||
# Valet
|
||||
|
||||
Valet gives OpenStack the ability to optimize cloud resources while simultaneously meeting a cloud application's QoS requirements. Valet provides an api service, a placement optimizer (Ostro), a high availability data storage and persistence layer (Music), and a set of OpenStack plugins.
|
||||
|
||||
**IMPORTANT**: [Overall AT&T AIC Installation of Valet is covered in a separate document](https://codecloud.web.att.com/plugins/servlet/readmeparser/display/ST_CLOUDQOS/allegro/atRef/refs/heads/master/renderFile/doc/aic/README.md).
|
||||
|
||||
Learn more about Valet:
|
||||
|
||||
* [OpenStack Newton Summit Presentation](https://www.openstack.org/videos/video/valet-holistic-data-center-optimization-for-openstack) (Austin, TX, 27 April 2016)
|
||||
* [Presentation Slides](http://www.research.att.com/export/sites/att_labs/techdocs/TD_101806.pdf) (PDF)
|
||||
|
||||
Valet consists of the following components:
|
||||
|
||||
* [valet-openstack](https://codecloud.web.att.com/plugins/servlet/readmeparser/display/ST_CLOUDQOS/allegro/atRef/refs/heads/master/renderFile/valet_os/README.md): a set of OpenStack plugins used to interact with Valet
|
||||
* [valet-api](https://codecloud.web.att.com/plugins/servlet/readmeparser/display/ST_CLOUDQOS/allegro/atRef/refs/heads/master/renderFile/valet_api/README.md): an API engine used to interact with Valet
|
||||
* [Ostro](https://codecloud.web.att.com/plugins/servlet/readmeparser/display/ST_CLOUDQOS/ostro/atRef/refs/heads/master/renderFile/README): a placement optimization engine
|
||||
* [Music](https://codecloud.web.att.com/plugins/servlet/readmeparser/display/ST_CLOUDQOS/music/atRef/refs/heads/master/renderFile/README.md): a data storage and persistence service
|
||||
* [ostro-listener](https://codecloud.web.att.com/plugins/servlet/readmeparser/display/ST_CLOUDQOS/allegro/atRef/refs/heads/master/renderFile/ostro_listener/README.md): a message bus listener used in conjunction with Ostro and Music
|
||||
* [havalet](https://codecloud.web.att.com/plugins/servlet/readmeparser/display/ST_CLOUDQOS/allegro/atRef/refs/heads/master/renderFile/havalet/README.md): a service that assists in providing high availability for Valet
|
||||
|
||||
Additional documents:
|
||||
|
||||
* [OpenStack Heat Resource Plugins](https://codecloud.web.att.com/plugins/servlet/readmeparser/display/ST_CLOUDQOS/allegro/atRef/refs/heads/master/renderFile/valet_os/etc/valet_os/heat/README.md): Heat resources
|
||||
* [Placement API](https://codecloud.web.att.com/plugins/servlet/readmeparser/display/ST_CLOUDQOS/allegro/atRef/refs/heads/master/renderFile/valet_api/doc/README.md): API requests/responses
|
||||
* [Using Postman with valet-api](https://codecloud.web.att.com/plugins/servlet/readmeparser/display/ST_CLOUDQOS/allegro/atRef/refs/heads/master/renderFile/valet_api/valet_api/tests/README.md): Postman support
|
||||
|
||||
## Thank You
|
||||
|
||||
Alicia Abella, Saar Alaluf, Bharath Balasubramanian, Roy Ben Hai, Shimon Benattar, Yael Ben Shalom, Benny Bustan, Rachel Cohen, Joe D'Andrea, Harel Dorfman, Boaz Elitzur, P.K. Esrawan, Inbal Harduf, Matti Hiltunen, Doron Honigsberg, Kaustubh Joshi, Gueyoung Jung, Gerald Karam, David Khanin, Israel Kliger, Erez Korn, Max Osipov, Chris Rice, Amnon Sagiv, Gideon Shafran, Galit Shemesh, Anna Yefimov; AT&T Advanced Technology and Architecture, AT&T Technology Development - AIC, Additional partners in AT&T Domain 2.0. Apologies if we missed anyone (please advise via email!).
|
||||
|
||||
## Contact
|
||||
|
||||
Joe D'Andrea <jdandrea@research.att.com>
|
||||
|
@ -1,26 +0,0 @@
|
||||
Valet1.0/Ostro features
|
||||
|
||||
- Optimal VM placement
|
||||
Use the decent algorithm, compute the holistic optimal placement for all VMs of given application. Working on NUMAAffinityFilter and PCIPassthroughFilter.
|
||||
|
||||
- Constraint solving (filtering)
|
||||
Current constraints (i.e., filters) include CoreFilter, RamFilter, DiskFilter, host aggregates, availability zones. Possibly, the decision making of Ostro is different from Nova when tenant attempts to use other filters available in Nova. In this case, Ostro yields its decision to Nova scheduler unless the tenant uses affinity, diversity, and exclusivity in Heat template. However, we will restrict some Nova filters if it affects cloud security, reliability, and efficiency.
|
||||
|
||||
- Affinity, Diversity, and Exclusivity in either host or rack level
|
||||
In addition of the above filters, support affinity, diversity (anti-affinity), and exclusivity. The rack level can be supported when the topology/layout information of site is available. Currently, use the host machine naming convention. If a site does not follow the naming convention, the rack level request will be rejected. Note that you can use the mix of these special filters and the basic filters.
|
||||
|
||||
- Resource standby
|
||||
When allocating resources (CPU, memory, disk, and later network bandwidth), Ostro intentionally leaves a certain percentage of resources as unused. This is because of the concern of load spikes of tenant applications. Later, we will deploy more dynamic mechanism in the future version of Ostro.
|
||||
|
||||
- High availability
|
||||
Ostro replicas run as active-passive way. When active Ostro fails, automatically the passive one is activated via HAValet. All data is updated in MUSIC database at runtime whenever it is changed. When the passive Ostro is activated, it gets data from MUSIC to initialize its status rather than from OpenStack. Ostro also takes ping messages to show if it is alive or not.
|
||||
|
||||
- Runtime update via the Oslo message bus or RO
|
||||
Working on this.
|
||||
|
||||
- Migration tip
|
||||
Working on this.
|
||||
|
||||
|
||||
|
||||
|
@ -1,6 +0,0 @@
|
||||
# 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.
|
||||
|
||||
pip
|
||||
simplejson
|
@ -1,34 +0,0 @@
|
||||
[metadata]
|
||||
name = valet_plugins
|
||||
version = 1.0
|
||||
summary = Valet Orchestration Plugins for OpenStack
|
||||
description-file = README.md
|
||||
author = AT&T
|
||||
author-email = jdandrea@research.att.com
|
||||
homepage = https://codecloud.web.att.com/projects/ST_CLOUDQOS/
|
||||
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 :: 2
|
||||
Programming Language :: Python :: 2.7
|
||||
|
||||
[global]
|
||||
setup-hooks =
|
||||
pbr.hooks.setup_hook
|
||||
|
||||
[files]
|
||||
packages =
|
||||
valet_plugins
|
||||
data_files =
|
||||
valet_plugins/heat = valet_plugins/heat/*
|
||||
|
||||
[entry_points]
|
||||
#cinder.scheduler.filters =
|
||||
# ValetFilter = valet_os.cinder.valet_filter:ValetFilter
|
||||
heat.stack_lifecycle_plugins =
|
||||
valet.lifecycle_plugin = valet_plugins.plugins.heat.plugins:ValetLifecyclePlugin
|
||||
|
@ -1,26 +0,0 @@
|
||||
#
|
||||
# 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 setuptools
|
||||
|
||||
# In python < 2.7.4, a lazy loading of package `pbr` will break
|
||||
# setuptools if some other modules registered functions in `atexit`.
|
||||
# solution from: http://bugs.python.org/issue15881#msg170215
|
||||
try:
|
||||
import multiprocessing # noqa # pylint: disable=W0611,C0411
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['pbr'],
|
||||
pbr=True)
|
@ -1,25 +0,0 @@
|
||||
# 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<0.11,>=0.10.0
|
||||
os-testr<=0.7.0
|
||||
markupsafe<=0.23
|
||||
pecan<=0.8.2
|
||||
notario<=0.0.11
|
||||
coverage>=3.6
|
||||
python-subunit>=0.0.18
|
||||
mock>=1.2
|
||||
oslotest>=1.10.0 # Apache-2.0
|
||||
oslo.config>=1.9.0
|
||||
testrepository>=0.0.18
|
||||
sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2
|
||||
testscenarios>=0.4
|
||||
testtools>=1.4.0
|
||||
oslo.i18n<=3.8.0
|
||||
oslo.log>=1.0.0
|
||||
pytz
|
||||
python-keystoneclient<=3.4.0
|
||||
python-novaclient<=4.0.0
|
||||
python-heatclient<=1.2.0
|
@ -1,55 +0,0 @@
|
||||
[tox]
|
||||
#minversion = 2.0
|
||||
envlist = py27
|
||||
#py27-constraints, pep8-constraints
|
||||
#py34-constraints,py27-constraints,pypy-constraints,pep8-constraints
|
||||
#skipsdist = True
|
||||
|
||||
|
||||
[testenv]
|
||||
usedevelop = True
|
||||
install_command =
|
||||
pip install -U {opts} {packages}
|
||||
|
||||
setenv = VIRTUAL_ENV={envdir}
|
||||
OS_TEST_PATH=valet_plugins/tests/unit/
|
||||
|
||||
|
||||
commands =
|
||||
find . -type f -name "*.pyc" -delete
|
||||
ostestr --slowest '{posargs}'
|
||||
deps = -r{toxinidir}/test-requirements.txt
|
||||
|
||||
whitelist_externals =
|
||||
bash
|
||||
find
|
||||
|
||||
|
||||
[testenv:pep8]
|
||||
commands = flake8
|
||||
#commands = flake8 {posargs}
|
||||
|
||||
|
||||
[testenv:venv]
|
||||
commands = {posargs}
|
||||
|
||||
|
||||
[testenv:cover]
|
||||
commands =
|
||||
coverage erase
|
||||
python setup.py test --slowest --coverage --coverage-package-name 'valet_plugins' --testr-args='{posargs}'
|
||||
coverage report
|
||||
|
||||
|
||||
[testenv:docs]
|
||||
commands = python setup.py build_sphinx
|
||||
|
||||
|
||||
[flake8]
|
||||
# E123, E125 skipped as they are invalid PEP-8.
|
||||
|
||||
show-source = True
|
||||
ignore = E123,E125,E501,H401,H501,H301
|
||||
builtins = _
|
||||
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,*egg-info
|
||||
|
@ -1,4 +0,0 @@
|
||||
Metadata-Version: 1.2
|
||||
Name: api
|
||||
Version: 0.1.0
|
||||
Author-email: jdandrea@research.att.com
|
@ -1,144 +0,0 @@
|
||||
#
|
||||
# Copyright 2014-2017 AT&T Intellectual Property
|
||||
#
|
||||
# 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.
|
||||
|
||||
'''Identity helper library'''
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
import iso8601
|
||||
# https://github.com/openstack/python-keystoneclient/blob/
|
||||
# master/keystoneclient/v2_0/client.py
|
||||
import keystoneauth1.exceptions
|
||||
from keystoneauth1.identity import v2
|
||||
from keystoneauth1 import session
|
||||
from keystoneclient.v2_0 import client
|
||||
from pecan import conf
|
||||
import pytz
|
||||
|
||||
|
||||
def utcnow():
|
||||
'''Returns the time (UTC)'''
|
||||
return datetime.now(tz=pytz.utc)
|
||||
|
||||
|
||||
class Identity(object):
|
||||
'''Convenience library for all identity service-related queries.'''
|
||||
_args = None
|
||||
_client = None
|
||||
_interface = None
|
||||
_session = None
|
||||
|
||||
@classmethod
|
||||
def is_token_admin(cls, token):
|
||||
'''Returns true if decoded token has an admin role'''
|
||||
for role in token.user.get('roles', []):
|
||||
if role.get('name') == 'admin':
|
||||
return True
|
||||
return False
|
||||
|
||||
@classmethod
|
||||
def tenant_from_token(cls, token):
|
||||
'''Returns tenant id from decoded token'''
|
||||
return token.tenant.get('id', None)
|
||||
|
||||
@classmethod
|
||||
def user_from_token(cls, token):
|
||||
'''Returns user id from decoded token'''
|
||||
return token.user.get('id', None)
|
||||
|
||||
def __init__(self, interface='admin', **kwargs):
|
||||
'''Initializer.'''
|
||||
self._interface = interface
|
||||
self._args = kwargs
|
||||
self._client = None
|
||||
self._session = None
|
||||
|
||||
@property
|
||||
def _client_expired(self):
|
||||
'''Returns True if cached client's token is expired.'''
|
||||
# NOTE: Keystone may auto-regen the client now (v2? v3?)
|
||||
# If so, this trip may no longer be necessary. Doesn't
|
||||
# hurt to keep it around for the time being.
|
||||
if not self._client or not self._client.auth_ref:
|
||||
return True
|
||||
token = self._client.auth_ref.get('token')
|
||||
if not token:
|
||||
return True
|
||||
timestamp = token.get('expires')
|
||||
if not timestamp:
|
||||
return True
|
||||
return iso8601.parse_date(timestamp) <= utcnow()
|
||||
|
||||
@property
|
||||
def client(self):
|
||||
'''Returns an identity client.'''
|
||||
if not self._client or self._client_expired:
|
||||
auth = v2.Password(**self._args)
|
||||
self._session = session.Session(auth=auth)
|
||||
self._client = client.Client(session=self._session,
|
||||
interface=self._interface)
|
||||
return self._client
|
||||
|
||||
@property
|
||||
def session(self):
|
||||
'''Read-only access to the session.'''
|
||||
return self._session
|
||||
|
||||
def validate_token(self, auth_token):
|
||||
'''Returns validated token or None if invalid'''
|
||||
kwargs = {
|
||||
'token': auth_token,
|
||||
}
|
||||
try:
|
||||
return self.client.tokens.validate(**kwargs)
|
||||
except keystoneauth1.exceptions.http.NotFound:
|
||||
# FIXME: Return a 404 or at least an auth required?
|
||||
pass
|
||||
return None
|
||||
|
||||
'''Returns true if tenant list contains valid tenant IDs'''
|
||||
tenants = self.client.tenants.list()
|
||||
if isinstance(tenant_list, list):
|
||||
for tenant_id in tenant_list:
|
||||
found = False
|
||||
for tenant in tenants:
|
||||
if tenant_id == tenant.id:
|
||||
found = True
|
||||
break
|
||||
if not found:
|
||||
return False
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def _identity_engine_from_config(config):
|
||||
'''Initialize the identity engine based on supplied config.'''
|
||||
# Using tenant_name instead of project name due to keystone v2
|
||||
kwargs = {
|
||||
'username': config.get('username'),
|
||||
'password': config.get('password'),
|
||||
'tenant_name': config.get('project_name'),
|
||||
'auth_url': config.get('auth_url'),
|
||||
}
|
||||
interface = config.get('interface')
|
||||
engine = Identity(interface, **kwargs)
|
||||
return engine
|
||||
|
||||
|
||||
def init_identity():
|
||||
'''Initialize the identity engine and place in the config.'''
|
||||
config = conf.identity.config
|
||||
engine = _identity_engine_from_config(config)
|
||||
conf.identity.engine = engine
|
Loading…
Reference in New Issue
Block a user