Commit 407d7029 by Chif Gergő

Resolve merge conflict

parents daea0676 380211d5
......@@ -5,3 +5,4 @@ recircle/clouds.yaml
recircle/implementation/
recircle/interface/
recircle/interface_openstack/
environment.sh
\ No newline at end of file
image: python:3.6
stages:
- lint
- test
flake8:
before_script:
- pip install flake8
stage: lint
script:
- flake8 --max-line-length=125 --exclude=migrations
test:
before_script:
- pip install pipenv
- pipenv install -d
- git submodule sync --recursive
- git submodule update --init --recursive
script:
- cd recircle
- pipenv run python manage.py test
[submodule "recircle/interface_openstack"]
path = recircle/interface_openstack
url = ../../RECIRCLE/interface-openstack
branch = DEV
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Pipenv (portal)" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/portal.iml" filepath="$PROJECT_DIR$/.idea/portal.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?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>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="a52621c9-a45f-44cc-a181-ce0260b2adf5" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/Pipfile" beforeDir="false" afterPath="$PROJECT_DIR$/Pipfile" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Pipfile.lock" beforeDir="false" afterPath="$PROJECT_DIR$/Pipfile.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/recircle/instance/models.py" beforeDir="false" afterPath="$PROJECT_DIR$/recircle/instance/models.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/recircle/instance/serializers.py" beforeDir="false" afterPath="$PROJECT_DIR$/recircle/instance/serializers.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/recircle/instance/tests.py" beforeDir="false" afterPath="$PROJECT_DIR$/recircle/instance/tests.py" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" 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="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectConfigurationFiles">
<option name="files">
<list>
<option value="$PROJECT_DIR$/.idea/portal.iml" />
<option value="$PROJECT_DIR$/.idea/misc.xml" />
<option value="$PROJECT_DIR$/.idea/modules.xml" />
<option value="$PROJECT_DIR$/.idea/vcs.xml" />
</list>
</option>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="260" />
<option name="y" value="544" />
<option name="width" value="1400" />
<option name="height" value="1000" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectView">
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="portal" type="b2602c69:ProjectViewProjectNode" />
<item name="portal" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="portal" type="b2602c69:ProjectViewProjectNode" />
<item name="portal" type="462c0819:PsiDirectoryNode" />
<item name="recircle" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
</panes>
</component>
<component name="PropertiesComponent">
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="a52621c9-a45f-44cc-a181-ce0260b2adf5" name="Default Changelist" comment="" />
<created>1562752855004</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1562752855004</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="260" y="544" width="1400" height="1000" extended-state="0" />
<layout>
<window_info id="Favorites" side_tool="true" />
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24981844" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info anchor="bottom" id="Version Control" />
<window_info anchor="bottom" id="Python Console" />
<window_info anchor="bottom" id="Terminal" />
<window_info anchor="bottom" id="Event Log" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
</layout>
</component>
</project>
\ No newline at end of file
......@@ -5,6 +5,7 @@ verify_ssl = true
[dev-packages]
httpie = "*"
flake8 = "*"
django-rest-swagger = "*"
coverage = "*"
......
......@@ -513,6 +513,21 @@
"index": "pypi",
"version": "==3.9.4"
},
"entrypoints": {
"hashes": [
"sha256:589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19",
"sha256:c70dd71abe5a8c85e55e12c19bd91ccfeec11a6e99044204511f9ed547d48451"
],
"version": "==0.3"
},
"flake8": {
"hashes": [
"sha256:859996073f341f2670741b51ec1e67a01da142831aa1fdc6242dbf88dffbe661",
"sha256:a796a115208f5c03b18f332f7c11729812c8c3ded6c46319c59b53efd3819da8"
],
"index": "pypi",
"version": "==3.7.7"
},
"httpie": {
"hashes": [
"sha256:449c07947be10ee1482fd7ac00b7fe0af499e0e85213fca4e97b6b69a95d61f5",
......@@ -574,12 +589,33 @@
],
"version": "==1.1.1"
},
"mccabe": {
"hashes": [
"sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42",
"sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"
],
"version": "==0.6.1"
},
"openapi-codec": {
"hashes": [
"sha256:1bce63289edf53c601ea3683120641407ff6b708803b8954c8a876fe778d2145"
],
"version": "==1.3.2"
},
"pycodestyle": {
"hashes": [
"sha256:95a2219d12372f05704562a14ec30bc76b05a5b297b21a5dfe3f6fac3491ae56",
"sha256:e40a936c9a450ad81df37f549d676d127b1b66000a6c500caa2b085bc0ca976c"
],
"version": "==2.5.0"
},
"pyflakes": {
"hashes": [
"sha256:17dbeb2e3f4d772725c777fabc446d5634d1038f234e77343108ce445ea69ce0",
"sha256:d976835886f8c5b31d47970ed689944a0262b5f3afa00a5a7b4dc81e5449f8a2"
],
"version": "==2.1.1"
},
"pygments": {
"hashes": [
"sha256:71e430bc85c88a430f000ac1d9b331d2407f681d6f6aec95e8bcfbc3df5b0127",
......
......@@ -50,3 +50,6 @@ A fejlesztés elkezdéséhez egy Django szerverrel fogunk dolgozni, mely az open
|------| |------| |---------| |--------|
```
### Devenv Setup
### Lease kezelés
Lease kezelés egyelőre nem lesz. A későbbiekben majd lesz valamilyen collector, ami időközönként lefut és ellenőrzi a suspended_at és a deleted_at változókat.
export OS_AUTH_URL=http://example/identity/v3
export OS_PROJECT_ID=123456789
export OS_PROJECT_NAME="example"
export OS_USER_DOMAIN_NAME="example"
export OS_USER_DOMAIN_ID="example"
export OS_PROJECT_DOMAIN_ID="example"
export OS_USERNAME="example"
export OS_PASSWORD=secret
export OS_REGION_NAME="example"
export OS_INTERFACE="example"
export OS_IDENTITY_API_VERSION=123
\ No newline at end of file
!coverage.py: This is a private format, don't read it directly!{"lines":{"/home/cloud/portal/recircle/manage.py":[2,3,5,6,7,8,15],"/home/cloud/portal/recircle/recircle/__init__.py":[1],"/home/cloud/portal/recircle/recircle/settings.py":[11,13,16,23,26,28,33,34,35,36,37,38,39,40,41,42,43,44,45,49,50,51,52,53,54,55,56,59,63,64,65,67,68,69,70,71,77,84,85,86,96,98,99,100,107,109,111,113,115,121,129,130,136,137,138,139,140,143,144,145,146,147,150,151,152,153,154,159],"/home/cloud/portal/recircle/instance/__init__.py":[1],"/home/cloud/portal/recircle/instance/apps.py":[1,4,5],"/home/cloud/portal/recircle/image/__init__.py":[1],"/home/cloud/portal/recircle/image/apps.py":[1,4,5],"/home/cloud/portal/recircle/template/__init__.py":[1],"/home/cloud/portal/recircle/instance/models.py":[1,2,3,4,5,6,7,10,11,15,19,20,21,22,23,26,29,30,31,32,33,35,36,37,38,41,43,45,46,48,49,51,52,54,55,56,58,59,60,62,63,64,66,67,68,70,71,72,81,82,83,85,86,87,88,90,97,113,117],"/home/cloud/portal/recircle/image/models.py":[1,4,7,9,10,12,13,14,15,16],"/home/cloud/portal/recircle/implementation/__init__.py":[1],"/home/cloud/portal/recircle/implementation/vm/__init__.py":[1],"/home/cloud/portal/recircle/implementation/vm/instance.py":[1,2,3,4,5,6,7,9,10,11,12,13,15,18,34,36,40,19,31,53,57,75,84,90,95,103,104,112,113,118,119,124,125,130,131,136,142,148,154,160,167,175,176,183,189,190,195,196,202],"/home/cloud/portal/recircle/interface/__init__.py":[1],"/home/cloud/portal/recircle/interface/vm/__init__.py":[1],"/home/cloud/portal/recircle/interface/vm/instance.py":[5,8,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58,61,64,67,70],"/home/cloud/portal/recircle/interface/vm/resources.py":[1,4,8,10,11,14,25,29,30,37,41,42,52],"/home/cloud/portal/recircle/template/models.py":[1,4,7,9,10,11,12,14,15,18,19,20,21,22],"/home/cloud/portal/recircle/instance/admin.py":[1,3,5],"/home/cloud/portal/recircle/image/admin.py":[1],"/home/cloud/portal/recircle/template/admin.py":[1],"/home/cloud/portal/recircle/instance/migrations/__init__.py":[1],"/home/cloud/portal/recircle/instance/tests.py":[1],"/home/cloud/portal/recircle/recircle/urls.py":[15,16,17,18,21,24,25,26,27,28,29],"/home/cloud/portal/recircle/image/urls.py":[1,2,3,5,7],"/home/cloud/portal/recircle/image/views.py":[1,2,4,5,6,9,11,14,15],"/home/cloud/portal/recircle/image/serializers.py":[1,3,6,7,8,9],"/home/cloud/portal/recircle/implementation/image/OpenstackImageManager.py":[1,3,4,7,9,14,22,31,39,42,50],"/home/cloud/portal/recircle/interface/image/ImageManager.py":[1,2,5,8,11,14,19,22],"/home/cloud/portal/recircle/interface/image/Image.py":[1,4,5,12,15],"/home/cloud/portal/recircle/instance/urls.py":[1,2,3,6,7,11],"/home/cloud/portal/recircle/instance/views.py":[1,2,3,4,5,6,7,8,9,10,13,15,18,21,22,26,53,56,58,64,76,84],"/home/cloud/portal/recircle/instance/serializers.py":[1,3,6,7,8,9],"/home/cloud/portal/recircle/instance/migrations/0001_initial.py":[],"/home/cloud/portal/recircle/instance/migrations/0003_auto_20190510_1307.py":[],"/home/cloud/portal/recircle/instance/migrations/0002_auto_20190502_1341.py":[],"/home/cloud/portal/recircle/instance/migrations/0005_auto_20190513_1203.py":[],"/home/cloud/portal/recircle/instance/migrations/0004_instance_remoteid.py":[],"/home/cloud/portal/recircle/instance/migrations/0007_auto_20190704_1256.py":[],"/home/cloud/portal/recircle/instance/migrations/0006_auto_20190704_1154.py":[],"/home/cloud/portal/recircle/instance/migrations/0008_auto_20190704_1310.py":[],"/home/cloud/portal/recircle/storage/admin.py":[],"/home/cloud/portal/recircle/storage/views.py":[],"/home/cloud/portal/recircle/storage/models.py":[],"/home/cloud/portal/recircle/storage/__init__.py":[],"/home/cloud/portal/recircle/storage/tests.py":[],"/home/cloud/portal/recircle/storage/apps.py":[],"/home/cloud/portal/recircle/storage/serializers.py":[],"/home/cloud/portal/recircle/storage/migrations/__init__.py":[],"/home/cloud/portal/recircle/recircle/wsgi.py":[],"/home/cloud/portal/recircle/interface/vm/templates.py":[],"/home/cloud/portal/recircle/template/views.py":[],"/home/cloud/portal/recircle/template/tests.py":[],"/home/cloud/portal/recircle/template/apps.py":[],"/home/cloud/portal/recircle/template/serializers.py":[],"/home/cloud/portal/recircle/template/migrations/0001_initial.py":[],"/home/cloud/portal/recircle/template/migrations/__init__.py":[],"/home/cloud/portal/recircle/image/tests.py":[],"/home/cloud/portal/recircle/image/migrations/0001_initial.py":[],"/home/cloud/portal/recircle/image/migrations/__init__.py":[]}}
\ No newline at end of file
......@@ -3,18 +3,16 @@ from image.serializers import DiskSerializer
# from django.shortcuts import render
from rest_framework.views import APIView
from rest_framework.response import Response
from implementation.image.OpenstackImageManager import (
from interface_openstack.implementation.image.openstack_image_manager import (
OpenstackImageManager,
)
import openstack
conn = openstack.connect(cloud="openstack")
from django.conf import settings
class DiskList(APIView):
def get(self, request, format=None):
# OpenStack
interface = OpenstackImageManager(conn)
interface = OpenstackImageManager(settings.CONNECTION)
return Response([disk.__dict__ for disk in interface.list()])
# Create response
......
......@@ -10,14 +10,6 @@ from instance.models import Instance, Flavor, Lease
from django.contrib.auth.models import User
import openstack
import datetime
conn = openstack.connect(cloud="openstack")
class InstanceList(APIView):
def get(self, request, format=None):
instances = Instance.objects.all()
......@@ -68,7 +60,7 @@ class InstanceDetail(APIView):
instance = self.get_object(pk)
instanceDict = InstanceSerializer(instance).data
interface = OSVirtualMachineManager(conn)
interface = OSVirtualMachineManager(settings.CONNECTION)
remoteInstance = interface.get_vm(instance.remote_id)
remoteInstanceDict = remoteInstance.__dict__
......
Subproject commit e01d873c78ac17fed0438936f979de3cbaca6a5e
......@@ -118,6 +118,7 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.1/howto/static-files/
STATIC_URL = "/static/"
###############################################################################
......@@ -157,3 +158,17 @@ LEASE_TYPES = [
# CORS config for development version only
CORS_ORIGIN_WHITELIST = ("http://localhost:3000",)
CONNECTION = {
"auth_url": os.getenv("OS_AUTH_URL"),
"project_id": os.getenv("OS_PROJECT_ID"),
"project_name": os.getenv("OS_PROJECT_NAME"),
"user_domain_name": os.getenv("OS_USER_DOMAIN_NAME", "Default"),
"user_domain_id": os.getenv("OS_USER_DOMAIN_ID", "default"),
"project_domain_id": os.getenv("OS_PROJECT_DOMAIN_ID", "default"),
"username": os.getenv("OS_USERNAME"),
"password": os.getenv("OS_PASSWORD"),
"region_name": os.getenv("OS_REGION_NAME"),
"interface": os.getenv("OS_INTERFACE"),
"identity_api_version": os.getenv("OS_IDENTITY_API_VERSION"),
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment