Commit b4fee3ab by Szabolcs Gelencser

Add automatic lease creation, renew operation

parent 895f7d98
......@@ -14,7 +14,7 @@
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredPackages">
<value>
<list size="9">
<list size="11">
<item index="0" class="java.lang.String" itemvalue="salt" />
<item index="1" class="java.lang.String" itemvalue="six" />
<item index="2" class="java.lang.String" itemvalue="netaddr" />
......@@ -24,6 +24,8 @@
<item index="6" class="java.lang.String" itemvalue="lxml" />
<item index="7" class="java.lang.String" itemvalue="MarkupSafe" />
<item index="8" class="java.lang.String" itemvalue="pylibmc" />
<item index="9" class="java.lang.String" itemvalue="pytz" />
<item index="10" class="java.lang.String" itemvalue="simplejson" />
</list>
</value>
</option>
......
......@@ -2,9 +2,30 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="1fbec8af-5a7c-40f9-b994-83ac07d1ae1d" name="Default" comment="">
<change beforePath="$PROJECT_DIR$/.gitignore" afterPath="$PROJECT_DIR$/.gitignore" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/vm/models/vm_lease.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/vm/startup.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/vm/tasks/lease_tasks.py" />
<change beforePath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change beforePath="$PROJECT_DIR$/circle/celery" afterPath="" />
<change beforePath="$PROJECT_DIR$/circle/circle/db.sqlite3" afterPath="$PROJECT_DIR$/circle/circle/db.sqlite3" />
<change beforePath="$PROJECT_DIR$/circle/circle/os_policies/circle_policy.json" afterPath="$PROJECT_DIR$/circle/circle/os_policies/circle_policy.json" />
<change beforePath="$PROJECT_DIR$/circle/circle/settings/base.py" afterPath="$PROJECT_DIR$/circle/circle/settings/base.py" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/_vm-renew.html" afterPath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/_vm-renew.html" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/lease-edit.html" afterPath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/lease-edit.html" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/template-list.html" afterPath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/template-list.html" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/_activity-timeline.html" afterPath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/_activity-timeline.html" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/home.html" afterPath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/home.html" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/urls.py" afterPath="$PROJECT_DIR$/circle/dashboard/urls.py" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/views/template.py" afterPath="$PROJECT_DIR$/circle/dashboard/views/template.py" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/views/util.py" afterPath="$PROJECT_DIR$/circle/dashboard/views/util.py" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/views/vm.py" afterPath="$PROJECT_DIR$/circle/dashboard/views/vm.py" />
<change beforePath="$PROJECT_DIR$/circle/openstack_api/keystone.py" afterPath="$PROJECT_DIR$/circle/openstack_api/keystone.py" />
<change beforePath="$PROJECT_DIR$/circle/request/templates/request/_request-lease-form.html" afterPath="$PROJECT_DIR$/circle/request/templates/request/_request-lease-form.html" />
<change beforePath="$PROJECT_DIR$/circle/vm/__init__.py" afterPath="$PROJECT_DIR$/circle/vm/__init__.py" />
<change beforePath="$PROJECT_DIR$/circle/vm/models/common.py" afterPath="$PROJECT_DIR$/circle/vm/models/common.py" />
<change beforePath="$PROJECT_DIR$/circle/vm/models/instance.py" afterPath="$PROJECT_DIR$/circle/vm/models/instance.py" />
<change beforePath="$PROJECT_DIR$/circle/vm/operations.py" afterPath="$PROJECT_DIR$/circle/vm/operations.py" />
<change beforePath="$PROJECT_DIR$/circle/vm/tasks/__init__.py" afterPath="$PROJECT_DIR$/circle/vm/tasks/__init__.py" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
......@@ -14,7 +35,7 @@
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CoverageDataManager">
<SUITE FILE_PATH="coverage/cloud$celery.coverage" NAME="celery Coverage Results" MODIFIED="1524474065640" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/circle" />
<SUITE FILE_PATH="coverage/cloud$celery.coverage" NAME="celery Coverage Results" MODIFIED="1526382929320" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/circle" />
<SUITE FILE_PATH="coverage/cloud$manage.coverage" NAME="manage Coverage Results" MODIFIED="1523272351887" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/circle" />
<SUITE FILE_PATH="coverage/cloud$operations.coverage" NAME="operations Coverage Results" MODIFIED="1521451585654" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/circle/common" />
</component>
......@@ -35,21 +56,107 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="base.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/circle/settings/base.py">
<file leaf-file-name="vm.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/vm.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="4">
<caret line="722" column="24" lean-forward="false" selection-start-line="722" selection-start-column="24" selection-end-line="722" selection-end-column="24" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="operations.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/vm/operations.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="318">
<caret line="668" column="42" lean-forward="false" selection-start-line="668" selection-start-column="42" selection-end-line="668" selection-end-column="42" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="_vm-renew.html" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/_vm-renew.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="363">
<caret line="408" column="27" lean-forward="false" selection-start-line="408" selection-start-column="27" selection-end-line="408" selection-end-column="27" />
<state relative-caret-position="204">
<caret line="12" column="33" lean-forward="false" selection-start-line="12" selection-start-column="33" selection-end-line="12" selection-end-column="33" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name=".gitignore" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/.gitignore">
<file leaf-file-name="_request-lease-form.html" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/request/templates/request/_request-lease-form.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="523">
<caret line="47" column="13" lean-forward="false" selection-start-line="47" selection-start-column="13" selection-end-line="47" selection-end-column="13" />
<state relative-caret-position="51">
<caret line="3" column="62" lean-forward="false" selection-start-line="3" selection-start-column="62" selection-end-line="3" selection-end-column="62" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="urls.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/dashboard/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="116">
<caret line="68" column="17" lean-forward="false" selection-start-line="68" selection-start-column="17" selection-end-line="68" selection-end-column="17" />
<folding>
<element signature="e#732#770#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="urls.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/request/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="446">
<caret line="58" column="32" lean-forward="false" selection-start-line="58" selection-start-column="32" selection-end-line="58" selection-end-column="32" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="home.html" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/home.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="170">
<caret line="58" column="25" lean-forward="false" selection-start-line="58" selection-start-column="14" selection-end-line="58" selection-end-column="25" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="lease_tasks.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/vm/tasks/lease_tasks.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="463">
<caret line="47" column="57" lean-forward="false" selection-start-line="47" selection-start-column="57" selection-end-line="47" selection-end-column="57" />
<folding>
<element signature="e#0#43#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="vm_lease.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/circle/vm/models/vm_lease.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="364">
<caret line="31" column="58" lean-forward="false" selection-start-line="31" selection-start-column="58" selection-end-line="31" selection-end-column="58" />
<folding>
<element signature="e#0#72#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="instance.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/vm/models/instance.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="213">
<caret line="19" column="0" lean-forward="false" selection-start-line="19" selection-start-column="0" selection-end-line="19" selection-end-column="30" />
<folding />
</state>
</provider>
......@@ -67,36 +174,36 @@
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>favourite</find>
<find>favouritev</find>
<find>v</find>
<find>get_template_names</find>
<find>operation-w</find>
<find>operation-wrapper</find>
<find>delete</find>
<find>network:</find>
<find>interface</find>
<find>instance</find>
<find>host_cls</find>
<find>DestroyOperation</find>
<find>operations</find>
<find>operation-wrapp</find>
<find>vxlandelet</find>
<find>os_po</find>
<find>accessmi</find>
<find>permissionreq</find>
<find>accessmix</find>
<find>LeaseDelete</find>
<find>has</find>
<find>policymi</find>
<find>acl</find>
<find>check</find>
<find>has_rights</find>
<find>os_polic</find>
<find>&quot;public&quot;</find>
<find>as _</find>
<find>AppConfig</find>
<find>VirtualMachineDescModel</find>
<find>Lease</find>
<find>import circle.vm</find>
<find>installed_apps</find>
<find>import settings</find>
<find>clean</find>
<find>timezone</find>
<find>suspend</find>
<find>is_expiring</find>
<find>timedelta</find>
<find>vm_ops</find>
<find>network_op</find>
<find>vmdetail</find>
<find>vxlandelete</find>
<find>vmdeply</find>
<find>connect</find>
<find>vxlandele</find>
<find>vxlandeta</find>
<find>exclude</find>
<find>lease</find>
<find>lease</find>
<find>installed</find>
<find>celery.task</find>
<find>@celery.task</find>
<find>celery</find>
<find>renew</find>
<find>VmRenewView</find>
<find>request</find>
<find>vm</find>
<find>pk</find>
</findStrings>
<replaceStrings>
<replace>'ACTIVE'</replace>
......@@ -119,33 +226,6 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/circle/openstack_auth/views.py" />
<option value="$PROJECT_DIR$/circle/circle/urls.py" />
<option value="$PROJECT_DIR$/circle/dashboard/validators.py" />
<option value="$PROJECT_DIR$/requirements/circlestack.txt" />
<option value="$PROJECT_DIR$/circle/vm/models/instance.py" />
<option value="$PROJECT_DIR$/circle/dashboard/tables.py" />
<option value="$PROJECT_DIR$/circle/vm/models/__init__.py" />
<option value="$PROJECT_DIR$/circle/vm/admin.py" />
<option value="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-plain-image-create.html" />
<option value="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/_network-public-ip-add.html" />
<option value="$PROJECT_DIR$/circle/dashboard/forms.py" />
<option value="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html" />
<option value="$PROJECT_DIR$/circle/dashboard/models.py" />
<option value="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail.html" />
<option value="$PROJECT_DIR$/circle/dashboard/templates/dashboard/index-vm.html" />
<option value="$PROJECT_DIR$/circle/dashboard/views/index.py" />
<option value="$PROJECT_DIR$/circle/dashboard/templates/dashboard/confirm/base-delete.html" />
<option value="$PROJECT_DIR$/circle/network/__init__.py" />
<option value="$PROJECT_DIR$/circle/network/models.py" />
<option value="$PROJECT_DIR$/circle/network/urls.py" />
<option value="$PROJECT_DIR$/circle/openstack_api/neutron.py" />
<option value="$PROJECT_DIR$/circle/network/forms.py" />
<option value="$PROJECT_DIR$/circle/network/operations.py" />
<option value="$PROJECT_DIR$/circle/network/views.py" />
<option value="$PROJECT_DIR$/circle/network/tables.py" />
<option value="$PROJECT_DIR$/circle/network/templates/network/vxlan-edit.html" />
<option value="$PROJECT_DIR$/circle/dashboard/views/template.py" />
<option value="$PROJECT_DIR$/COPYING" />
<option value="$PROJECT_DIR$/circle/manager/moncelery.py" />
<option value="$PROJECT_DIR$/circle/manager/slowcelery.py" />
......@@ -159,17 +239,44 @@
<option value="$PROJECT_DIR$/circle/vm/tasks/net_tasks.py" />
<option value="$PROJECT_DIR$/circle/storage/tasks/local_tasks.py" />
<option value="$PROJECT_DIR$/circle/storage/tasks/storage_tasks.py" />
<option value="$PROJECT_DIR$/circle/vm/operations.py" />
<option value="$PROJECT_DIR$/circle/vm/tasks/local_tasks.py" />
<option value="$PROJECT_DIR$/circle/vm/tasks/vm_tasks.py" />
<option value="$PROJECT_DIR$/circle/dashboard/views/vm.py" />
<option value="$PROJECT_DIR$/circle/manager/leasemanager.py" />
<option value="$PROJECT_DIR$/circle/vm/tasks.py" />
<option value="$PROJECT_DIR$/circle/circle/settings/base.py" />
<option value="$PROJECT_DIR$/circle/vm/tasks/__init__.py" />
<option value="$PROJECT_DIR$/circle/vm/__init__.py" />
<option value="$PROJECT_DIR$/circle/vm/tasks/test.py" />
<option value="$PROJECT_DIR$/.gitignore" />
<option value="$PROJECT_DIR$/circle/vm/tasks/__init__.py" />
<option value="$PROJECT_DIR$/circle/openstack_api/nova.py" />
<option value="$PROJECT_DIR$/circle/openstack_auth/attributes.py" />
<option value="$PROJECT_DIR$/circle/openstack_api/keystone.py" />
<option value="$PROJECT_DIR$/circle/openstack_auth/backend.py" />
<option value="$PROJECT_DIR$/circle/openstack_api/__init__.py" />
<option value="$PROJECT_DIR$/circle/openstack_auth/utils.py" />
<option value="$PROJECT_DIR$/circle/circle/middleware.py" />
<option value="$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/pankoclient/common/base.py" />
<option value="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/_activity-timeline.html" />
<option value="$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/pankoclient/utils.py" />
<option value="$PROJECT_DIR$/circle/dashboard/templates/dashboard/template-list.html" />
<option value="$PROJECT_DIR$/circle/circle/os_policies/nova_policy.json" />
<option value="$PROJECT_DIR$/circle/circle/os_policies/circle_policy.json" />
<option value="$PROJECT_DIR$/circle/dashboard/templates/dashboard/lease-edit.html" />
<option value="$PROJECT_DIR$/circle/dashboard/views/template.py" />
<option value="$PROJECT_DIR$/circle/dashboard/urls.py" />
<option value="$PROJECT_DIR$/circle/dashboard/views/util.py" />
<option value="$PROJECT_DIR$/circle/vm/models/instance.py" />
<option value="$PROJECT_DIR$/circle/vm/models/common.py" />
<option value="$PROJECT_DIR$/circle/common/__init__.py" />
<option value="$PROJECT_DIR$/circle/circle/__init__.py" />
<option value="$PROJECT_DIR$/circle/vm/startup.py" />
<option value="$PROJECT_DIR$/circle/vm/__init__.py" />
<option value="$PROJECT_DIR$/circle/circle/settings/base.py" />
<option value="$PROJECT_DIR$/circle/vm/tasks/lease_tasks.py" />
<option value="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/home.html" />
<option value="$PROJECT_DIR$/circle/vm/models/vm_lease.py" />
<option value="$PROJECT_DIR$/circle/dashboard/views/vm.py" />
<option value="$PROJECT_DIR$/circle/dashboard/templates/dashboard/_vm-renew.html" />
<option value="$PROJECT_DIR$/circle/request/templates/request/_request-lease-form.html" />
<option value="$PROJECT_DIR$/circle/vm/operations.py" />
</list>
</option>
</component>
......@@ -227,6 +334,7 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="Scratches" />
<pane id="ProjectPane">
<subPane>
......@@ -243,13 +351,37 @@
<path>
<item name="cloud" type="b2602c69:ProjectViewProjectNode" />
<item name="cloud" type="462c0819:PsiDirectoryNode" />
<item name="requirements" type="462c0819:PsiDirectoryNode" />
<item name="circle" type="462c0819:PsiDirectoryNode" />
<item name="dashboard" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="cloud" type="b2602c69:ProjectViewProjectNode" />
<item name="cloud" type="462c0819:PsiDirectoryNode" />
<item name="circle" type="462c0819:PsiDirectoryNode" />
<item name="dashboard" type="462c0819:PsiDirectoryNode" />
<item name="templates" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="cloud" type="b2602c69:ProjectViewProjectNode" />
<item name="cloud" type="462c0819:PsiDirectoryNode" />
<item name="circle" type="462c0819:PsiDirectoryNode" />
<item name="dashboard" type="462c0819:PsiDirectoryNode" />
<item name="templates" type="462c0819:PsiDirectoryNode" />
<item name="dashboard" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="cloud" type="b2602c69:ProjectViewProjectNode" />
<item name="cloud" type="462c0819:PsiDirectoryNode" />
<item name="circle" type="462c0819:PsiDirectoryNode" />
<item name="dashboard" type="462c0819:PsiDirectoryNode" />
<item name="templates" type="462c0819:PsiDirectoryNode" />
<item name="dashboard" type="462c0819:PsiDirectoryNode" />
<item name="vm-detail" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
......@@ -258,7 +390,7 @@
<property name="settings.editor.selected.configurable" value="watcher.settings" />
<property name="NewWatcherDialog.advanced.open" value="true" />
<property name="DefaultHtmlFileTemplate" value="HTML File" />
<property name="SearchEverywhereHistoryKey" value="local&#9;null&#9;null&#10;base&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/base.py&#10;base.py&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/base.py&#10;templateli&#9;null&#9;null&#10;te&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/template-list.html&#10;vmcrea&#9;null&#9;null&#10;index-tem&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-templates.html&#10;index&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vm.html&#10;urls&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/urls.py&#10;vxla&#9;FILE&#9;file:///home/h3yduck/cloud/circle/network/templates/network/vxlan-edit.html&#10;operat&#9;FILE&#9;file:///home/h3yduck/cloud/circle/network/operations.py&#10;network&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-detail/network.html&#10;vmdetail&#9;null&#9;null&#10;vmdeta&#9;null&#9;null&#10;forms.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/forms.py&#10;urls.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/urls.py&#10;nova&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/os_policies/nova_policy.json&#10;neutron_p&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/os_policies/neutron_policy.json&#10;operations&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;base-d&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/confirm/base-delete.html&#10;indexvi&#9;null&#9;null&#10;vm-de&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-detail.html&#10;index-v&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vm.html&#10;detailvi&#9;null&#9;null&#10;nova.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/os_policies/nova_policy.json&#10;operation&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;indev&#9;null&#9;null&#10;indexview&#9;null&#9;null&#10;operatio&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;vxlanc&#9;null&#9;null&#10;plain&#9;null&#9;null&#10;base.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/base.py&#10;views.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/openstack_auth/views.py&#10;login.html&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/auth/login.html&#10;LoginVi&#9;null&#9;null&#10;indexv&#9;null&#9;null&#10;index-vm&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vm.html&#10;index.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/views/index.py&#10;bas&#9;FILE&#9;file:///home/h3yduck/cloud/circle/openstack_api/base.py&#10;save&#9;null&#9;null&#10;plainc&#9;null&#9;null&#10;templatedet&#9;null&#9;null&#10;instancetemp&#9;null&#9;null&#10;instancetem&#9;null&#9;null&#10;url&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/urls.py&#10;vmcreate&#9;null&#9;null&#10;opera&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;templat&#9;null&#9;null&#10;vmadd&#9;null&#9;null&#10;addinterfa&#9;null&#9;null" />
<property name="SearchEverywhereHistoryKey" value="renewope&#9;null&#9;null&#10;urls&#9;FILE&#9;file:///home/h3yduck/cloud/circle/request/urls.py&#10;url&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/urls.py&#10;instan&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/models/instance.py&#10;vmle&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/models/vm_lease.py&#10;vmdeta&#9;null&#9;null&#10;instance&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/models/instance.py&#10;lease&#9;null&#9;null&#10;Lease&#9;null&#9;null&#10;base&#9;null&#9;null&#10;instancete&#9;null&#9;null&#10;Template&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/views/template.py&#10;nova_pol&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/os_policies/nova_policy.json&#10;PermissionReq&#9;null&#9;null&#10;circlepol&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/os_policies/circle_policy.json&#10;templatelist&#9;null&#9;null&#10;vmdetail&#9;null&#9;null&#10;Instance&#9;null&#9;null&#10;sessionclient&#9;null&#9;null&#10;middlewa&#9;null&#9;null&#10;backe&#9;FILE&#9;file:///home/h3yduck/cloud/circle/openstack_auth/backend.py&#10;local&#9;null&#9;null&#10;base.py&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/base.py&#10;templateli&#9;null&#9;null&#10;te&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/template-list.html&#10;vmcrea&#9;null&#9;null&#10;index-tem&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-templates.html&#10;index&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vm.html&#10;vxla&#9;FILE&#9;file:///home/h3yduck/cloud/circle/network/templates/network/vxlan-edit.html&#10;operat&#9;FILE&#9;file:///home/h3yduck/cloud/circle/network/operations.py&#10;network&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-detail/network.html&#10;forms.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/forms.py&#10;urls.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/urls.py&#10;nova&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/os_policies/nova_policy.json&#10;neutron_p&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/os_policies/neutron_policy.json&#10;operations&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;base-d&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/confirm/base-delete.html&#10;indexvi&#9;null&#9;null&#10;vm-de&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-detail.html&#10;index-v&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vm.html&#10;detailvi&#9;null&#9;null&#10;nova.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/os_policies/nova_policy.json&#10;operation&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;indev&#9;null&#9;null&#10;indexview&#9;null&#9;null&#10;operatio&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;vxlanc&#9;null&#9;null&#10;plain&#9;null&#9;null&#10;base.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/base.py&#10;views.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/openstack_auth/views.py" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
......@@ -282,7 +414,7 @@
</list>
</option>
</component>
<component name="RunManager" selected="Python.celery">
<component name="RunManager" selected="Django server.circlestack">
<configuration name="celery" type="PythonConfigurationType" factoryName="Python">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
......@@ -424,24 +556,23 @@
</component>
<component name="ToolWindowManager">
<frame x="-2" y="-1" width="1370" height="751" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.329653" sideWeight="0.4978701" 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.7097792" sideWeight="0.51283985" order="7" 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="true" weight="0.32492113" sideWeight="0.4976526" order="7" 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.43023255" sideWeight="0.43610224" order="7" side_tool="true" 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.7097792" sideWeight="0.51283985" order="11" side_tool="true" content_ui="tabs" />
<window_info id="Version Control" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32120255" sideWeight="0.49471298" order="7" 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.43023255" sideWeight="0.43610224" order="8" side_tool="true" 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.32769555" sideWeight="0.49574015" order="2" 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.7097792" sideWeight="0.51888216" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25830814" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Docker" 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="8" side_tool="false" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" 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.3280757" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="SciView" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" 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.27373418" sideWeight="0.5250266" order="10" side_tool="true" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.17975831" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Docker" 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="12" side_tool="false" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" 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.32769555" sideWeight="0.4978701" order="1" side_tool="false" content_ui="tabs" />
<window_info id="SciView" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" 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="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="2" side_tool="true" 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.7097792" sideWeight="0.4811178" order="3" 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.45886075" sideWeight="0.47497338" order="3" side_tool="false" 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="Messages" 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="7" side_tool="false" content_ui="tabs" />
<window_info id="Messages" 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="9" side_tool="false" content_ui="tabs" />
<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="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" />
......@@ -449,30 +580,6 @@
<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="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" />
</layout>
<layout-to-restore>
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32980973" sideWeight="0.4978701" order="6" side_tool="false" 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="Messages" 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="7" side_tool="false" content_ui="tabs" />
<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="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.327818" sideWeight="0.5021299" order="8" side_tool="true" 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="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32769555" sideWeight="0.514377" order="9" 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.43023255" sideWeight="0.43610224" order="10" side_tool="true" 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.32769555" sideWeight="0.49574015" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Coverage" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="true" 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.34542587" sideWeight="0.49320242" order="11" side_tool="true" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.23867069" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<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="Docker" 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="12" side_tool="false" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" 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.32980973" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="SciView" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" 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="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="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="2" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.5977918" sideWeight="0.5067976" order="3" side_tool="false" content_ui="tabs" />
</layout-to-restore>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
......@@ -519,11 +626,6 @@
<line>69</line>
<option name="timeStamp" value="317" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/circle/vm/tasks/local_periodic_tasks.py</url>
<line>43</line>
<option name="timeStamp" value="351" />
</line-breakpoint>
</breakpoints>
<breakpoints-dialog>
<breakpoints-dialog />
......@@ -535,56 +637,59 @@
</properties>
</breakpoint>
</default-breakpoints>
<option name="time" value="358" />
<option name="time" value="432" />
</breakpoint-manager>
<watches-manager />
</component>
<component name="debuggerHistoryManager">
<expressions id="evaluateCodeFragment">
<expression>
<expression-string>import ceilometerclient.client</expression-string>
<language-id>Python</language-id>
<expression-string>object.id</expression-string>
<language-id>HTML</language-id>
<evaluation-mode>CODE_FRAGMENT</evaluation-mode>
</expression>
<expression>
<expression-string>openstack_api.neutron.floating_ip_associate(request, '726906f3-0d05-4440-9027-da11bedef351', port_id)</expression-string>
<expression-string>client.servers.list()</expression-string>
<language-id>Python</language-id>
<evaluation-mode>CODE_FRAGMENT</evaluation-mode>
</expression>
<expression>
<expression-string>openstack_api.neutron.subnetpool_get(request, 'default')</expression-string>
<expression-string>client.server.list()</expression-string>
<language-id>Python</language-id>
<evaluation-mode>CODE_FRAGMENT</evaluation-mode>
</expression>
<expression>
<expression-string>session.post(token_url, json=body, headers=headers,
authenticated=False, log=False, **rkwargs)</expression-string>
<expression-string>check(self.os_policy_actions, self.request)</expression-string>
<language-id>Python</language-id>
<evaluation-mode>CODE_FRAGMENT</evaluation-mode>
</expression>
<expression>
<expression-string>auth.authenticate(request=request, auth_url=(auth_url), token=token)</expression-string>
<expression-string>check(self.os_policy_actions, self.request,
{'project_id': self.request.user.tenant_id})</expression-string>
<language-id>Python</language-id>
<evaluation-mode>CODE_FRAGMENT</evaluation-mode>
</expression>
<expression>
<expression-string>auth.authenticate(request=request, auth_url=(auth_url + '/v3'), token=token)</expression-string>
<expression-string>check(((&quot;circle&quot;, &quot;domain:list&quot;),), self.request,
{'project_id': self.request.user.tenant_id})</expression-string>
<language-id>Python</language-id>
<evaluation-mode>CODE_FRAGMENT</evaluation-mode>
</expression>
<expression>
<expression-string>auth.authenticate(request=request, auth_url=auth_url + '/v3', token=token)</expression-string>
<expression-string>check(((&quot;identity&quot;, &quot;domain:list&quot;),), self.request,
{'project_id': self.request.user.tenant_id})</expression-string>
<language-id>Python</language-id>
<evaluation-mode>CODE_FRAGMENT</evaluation-mode>
</expression>
<expression>
<expression-string>auth.authenticate(request=request, auth_url=auth_url, token=token)</expression-string>
<expression-string>check(((&quot;circle&quot;, &quot;lease:managea&quot;),), self.request,
{'project_id': self.request.user.tenant_id})</expression-string>
<language-id>Python</language-id>
<evaluation-mode>CODE_FRAGMENT</evaluation-mode>
</expression>
<expression>
<expression-string>import certifi
certifi.where()</expression-string>
<expression-string>check(((&quot;circle&quot;, &quot;lease:manage&quot;),), self.request,
{'project_id': self.request.user.tenant_id})</expression-string>
<language-id>Python</language-id>
<evaluation-mode>CODE_FRAGMENT</evaluation-mode>
</expression>
......@@ -603,468 +708,473 @@ certifi.where()</expression-string>
</expressions>
<expressions id="evaluateExpression">
<expression>
<expression-string>[p for p in ports if p.network_id == self.instance.id]</expression-string>
<expression-string>panko.event.list()</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>[p for p in ports if p.network == self.instance.id]</expression-string>
<expression-string>panko.event.list(limit=20)</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>openstack_api.neutron.port_list(request)</expression-string>
<expression-string>activities = panko.event.list()</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>openstack_api.neutron.port_list(request, network=self.instance.id)</expression-string>
<expression-string>self.request.user</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>Favourite.objects.get(instance=vm_id, user=user_id)</expression-string>
<expression-string>keystone.projects.list(domain=&quot;0cfb6010abcc405ebd19eb5b8f72949d&quot;, user=&quot;97980e2747994acba7982d3262c1f3e2&quot;)</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>Favourite.objects.filter(instance=vm_id, user=user_id)</expression-string>
<expression-string>keystone.projects.list(domain=&quot;0cfb6010abcc405ebd19eb5b8f72949d&quot;, user=&quot;circle&quot;)</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>Favourite.objects.filter(instance=vm_id, user=user_id).delete()</expression-string>
<expression-string>keystone.projects.list(domain=&quot;0cfb6010abcc405ebd19eb5b8f72949d&quot;)</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>self.get_op()</expression-string>
<expression-string>keystone.projects.list(domain=&quot;bme&quot;, user=&quot;circle&quot;)</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>openstack_api.neutron.tenant_floating_ip_list(self.request)</expression-string>
<expression-string>keystone.projects.list(domain=&quot;bme&quot;)</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
</expressions>
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/circle/network/__init__.py">
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/conf/__init__.py">
<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" />
<state relative-caret-position="541">
<caret line="200" column="0" lean-forward="false" selection-start-line="200" selection-start-column="0" selection-end-line="200" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/forms.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="194">
<caret line="926" column="6" lean-forward="false" selection-start-line="926" selection-start-column="6" selection-end-line="926" selection-end-column="6" />
<state relative-caret-position="297">
<caret line="246" column="67" lean-forward="false" selection-start-line="246" selection-start-column="66" selection-end-line="246" selection-end-column="67" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/openstack_api/nova.py">
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/novaclient/base.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="423">
<caret line="160" column="0" lean-forward="true" selection-start-line="160" selection-start-column="0" selection-end-line="160" selection-end-column="0" />
<folding />
<state relative-caret-position="177">
<caret line="355" column="0" lean-forward="false" selection-start-line="355" selection-start-column="0" selection-end-line="355" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/network/forms.py">
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/novaclient/client.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="380">
<caret line="387" column="0" lean-forward="false" selection-start-line="387" selection-start-column="0" selection-end-line="387" selection-end-column="0" />
<state relative-caret-position="381">
<caret line="76" column="0" lean-forward="false" selection-start-line="76" selection-start-column="0" selection-end-line="76" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py">
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/keystoneauth1/identity/generic/base.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="66">
<caret line="784" column="39" lean-forward="false" selection-start-line="784" selection-start-column="39" selection-end-line="784" selection-end-column="39" />
<folding />
<state relative-caret-position="488">
<caret line="207" column="0" lean-forward="false" selection-start-line="207" selection-start-column="0" selection-end-line="207" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/openstack_api/neutron.py">
<entry file="file://$PROJECT_DIR$/circle/circle/middleware.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="202">
<caret line="1384" column="4" lean-forward="false" selection-start-line="1384" selection-start-column="4" selection-end-line="1384" selection-end-column="4" />
<state relative-caret-position="34">
<caret line="2" column="24" lean-forward="true" selection-start-line="2" selection-start-column="24" selection-end-line="2" selection-end-column="24" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/common/operations.py">
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/pankoclient/common/base.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="52">
<caret line="89" column="0" lean-forward="false" selection-start-line="89" selection-start-column="0" selection-end-line="89" selection-end-column="0" />
<folding />
<state relative-caret-position="296">
<caret line="52" column="8" lean-forward="false" selection-start-line="52" selection-start-column="8" selection-end-line="52" selection-end-column="8" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html">
<entry file="file://$PROJECT_DIR$/circle/openstack_api/keystone.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1088">
<caret line="88" column="29" lean-forward="false" selection-start-line="88" selection-start-column="29" selection-end-line="88" selection-end-column="29" />
<state relative-caret-position="17">
<caret line="190" column="36" lean-forward="true" selection-start-line="190" selection-start-column="36" selection-end-line="190" selection-end-column="36" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/util.py">
<entry file="file://$PROJECT_DIR$/circle/openstack_api/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="44">
<caret line="107" column="41" lean-forward="false" selection-start-line="107" selection-start-column="27" selection-end-line="107" selection-end-column="41" />
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="true" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/views/generic/list.py">
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/pankoclient/v2/events.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="358">
<caret line="159" column="0" lean-forward="false" selection-start-line="159" selection-start-column="0" selection-end-line="159" selection-end-column="0" />
<state relative-caret-position="204">
<caret line="46" column="45" lean-forward="false" selection-start-line="46" selection-start-column="45" selection-end-line="46" selection-end-column="45" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/network/operations.py">
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/pankoclient/utils.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="448">
<caret line="57" column="15" lean-forward="false" selection-start-line="57" selection-start-column="15" selection-end-line="57" selection-end-column="47" />
<folding>
<element signature="e#0#20#0" expanded="false" />
</folding>
<state relative-caret-position="431">
<caret line="31" column="31" lean-forward="false" selection-start-line="31" selection-start-column="31" selection-end-line="31" selection-end-column="31" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django_tables2/views.py">
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/activity.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="202">
<caret line="118" column="6" lean-forward="false" selection-start-line="118" selection-start-column="6" selection-end-line="118" selection-end-column="6" />
<state relative-caret-position="85">
<caret line="5" column="50" lean-forward="false" selection-start-line="5" selection-start-column="50" selection-end-line="5" selection-end-column="50" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/network/tables.py">
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/_activity-timeline.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="100">
<caret line="231" column="20" lean-forward="true" selection-start-line="231" selection-start-column="20" selection-end-line="231" selection-end-column="20" />
<state relative-caret-position="85">
<caret line="5" column="27" lean-forward="false" selection-start-line="5" selection-start-column="27" selection-end-line="5" selection-end-column="27" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/network/views.py">
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/keystoneauth1/identity/v3/token.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="35">
<caret line="972" column="25" lean-forward="false" selection-start-line="972" selection-start-column="25" selection-end-line="972" selection-end-column="25" />
<state relative-caret-position="550">
<caret line="52" column="8" lean-forward="false" selection-start-line="52" selection-start-column="8" selection-end-line="52" selection-end-column="8" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/network/templates/network/vxlan-edit.html">
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django_tables2/views.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="176">
<caret line="39" column="6" lean-forward="true" selection-start-line="39" selection-start-column="6" selection-end-line="39" selection-end-column="6" />
<state relative-caret-position="202">
<caret line="107" column="8" lean-forward="true" selection-start-line="107" selection-start-column="8" selection-end-line="107" selection-end-column="8" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/urls.py">
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/template-list.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="119">
<caret line="59" column="18" lean-forward="true" selection-start-line="59" selection-start-column="18" selection-end-line="59" selection-end-column="20" />
<state relative-caret-position="278">
<caret line="53" column="0" lean-forward="false" selection-start-line="53" selection-start-column="0" selection-end-line="53" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/index.py">
<entry file="file://$PROJECT_DIR$/circle/circle/os_policies/nova_policy.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="265">
<caret line="103" column="31" lean-forward="false" selection-start-line="103" selection-start-column="31" selection-end-line="103" selection-end-column="80" />
<state relative-caret-position="102">
<caret line="6" column="0" lean-forward="false" selection-start-line="6" selection-start-column="0" selection-end-line="6" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/index-templates.html">
<entry file="file://$PROJECT_DIR$/circle/network/operations.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="44">
<caret line="11" column="0" lean-forward="false" selection-start-line="11" selection-start-column="0" selection-end-line="11" selection-end-column="0" />
<state relative-caret-position="236">
<caret line="26" column="0" lean-forward="true" selection-start-line="24" selection-start-column="12" selection-end-line="26" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/index-vm.html">
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/util.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="285">
<caret line="79" column="31" lean-forward="true" selection-start-line="79" selection-start-column="31" selection-end-line="79" selection-end-column="31" />
<state relative-caret-position="80">
<caret line="739" column="37" lean-forward="false" selection-start-line="739" selection-start-column="37" selection-end-line="739" selection-end-column="37" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/template.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="425">
<caret line="270" column="69" lean-forward="false" selection-start-line="270" selection-start-column="69" selection-end-line="270" selection-end-column="69" />
<state relative-caret-position="250">
<caret line="441" column="31" lean-forward="false" selection-start-line="441" selection-start-column="31" selection-end-line="441" selection-end-column="31" />
<folding>
<element signature="e#731#787#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/lease-edit.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="119">
<caret line="7" column="17" lean-forward="false" selection-start-line="7" selection-start-column="17" selection-end-line="7" selection-end-column="17" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/template-list.html">
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/braces/views/_access.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="125">
<caret line="16" column="18" lean-forward="true" selection-start-line="16" selection-start-column="18" selection-end-line="16" selection-end-column="18" />
<state relative-caret-position="122">
<caret line="58" column="28" lean-forward="false" selection-start-line="58" selection-start-column="8" selection-end-line="58" selection-end-column="28" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/monitor/tasks/local_periodic_tasks.py">
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/contrib/auth/mixins.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1439">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<state relative-caret-position="119">
<caret line="42" column="8" lean-forward="false" selection-start-line="42" selection-start-column="8" selection-end-line="42" selection-end-column="8" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/COPYING">
<entry file="file://$USER_HOME$/.virtualenvs/cloud/lib/python2.7/site-packages/django/contrib/auth/mixins.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="202">
<caret line="18" column="17" lean-forward="false" selection-start-line="18" selection-start-column="17" selection-end-line="18" selection-end-column="17" />
<state relative-caret-position="-408">
<caret line="8" column="6" lean-forward="false" selection-start-line="8" selection-start-column="6" selection-end-line="8" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/vm/models/instance.py">
<entry file="file://$PROJECT_DIR$/circle/circle/os_policies/circle_policy.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="108">
<caret line="395" column="10" lean-forward="true" selection-start-line="395" selection-start-column="8" selection-end-line="395" selection-end-column="13" />
<state relative-caret-position="68">
<caret line="4" column="24" lean-forward="false" selection-start-line="4" selection-start-column="24" selection-end-line="4" selection-end-column="24" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/vm/tasks/local_periodic_tasks.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-408">
<state relative-caret-position="-355">
<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 />
<folding>
<element signature="e#732#746#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/requirements/circlestack.txt">
<entry file="file://$PROJECT_DIR$/circle/vm/tests/test_models.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="255">
<caret line="15" column="13" lean-forward="true" selection-start-line="15" selection-start-column="13" selection-end-line="15" selection-end-column="13" />
<state relative-caret-position="88">
<caret line="23" column="32" lean-forward="false" selection-start-line="23" selection-start-column="32" selection-end-line="24" selection-end-column="55" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/manager/moncelery.py">
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/db/models/query.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="380">
<caret line="73" column="0" lean-forward="true" selection-start-line="0" selection-start-column="0" selection-end-line="79" selection-end-column="0" />
<state relative-caret-position="207">
<caret line="377" column="41" lean-forward="false" selection-start-line="377" selection-start-column="29" selection-end-line="377" selection-end-column="41" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/manager/slowcelery.py">
<entry file="file://$PROJECT_DIR$/circle/common/backends.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="414">
<caret line="44" column="43" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="57" selection-end-column="0" />
<state relative-caret-position="-609">
<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>
<entry file="file://$PROJECT_DIR$/circle/manager/scheduler.py">
<entry file="file://$PROJECT_DIR$/circle/common/__init__.py">
<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="126" selection-end-column="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>
<entry file="file://$PROJECT_DIR$/circle/manager/mancelery.py">
<entry file="file:///usr/lib/python2.7/importlib/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="295">
<caret line="50" column="12" lean-forward="true" selection-start-line="0" selection-start-column="0" selection-end-line="67" selection-end-column="0" />
<state relative-caret-position="180">
<caret line="36" column="0" lean-forward="false" selection-start-line="36" selection-start-column="0" selection-end-line="36" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/common/models.py">
<entry file="file://$PROJECT_DIR$/circle/circle/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="214">
<caret line="244" column="14" lean-forward="false" selection-start-line="244" selection-start-column="3" selection-end-line="244" selection-end-column="14" />
<folding>
<element signature="e#732#761#0" expanded="false" />
</folding>
<state relative-caret-position="190">
<caret line="21" column="0" lean-forward="true" selection-start-line="21" selection-start-column="0" selection-end-line="21" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/vm/models/activity.py">
<entry file="file://$PROJECT_DIR$/circle/vm/models/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="214">
<caret line="145" column="23" lean-forward="false" selection-start-line="145" selection-start-column="23" selection-end-line="145" selection-end-column="23" />
<state relative-caret-position="17">
<caret line="1" column="0" lean-forward="false" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
<folding>
<element signature="e#732#788#0" expanded="false" />
<element signature="e#15#53#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/vm/tasks/agent_tasks.py">
<entry file="file://$USER_HOME$/.PyCharm2017.3/system/python_stubs/-66389823/datetime.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1082">
<caret line="90" column="13" lean-forward="false" selection-start-line="90" selection-start-column="13" selection-end-line="90" selection-end-column="13" />
<state relative-caret-position="202">
<caret line="275" column="48" lean-forward="false" selection-start-line="275" selection-start-column="48" selection-end-line="275" selection-end-column="48" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/storage/tasks/local_tasks.py">
<entry file="file://$PROJECT_DIR$/circle/circle/settings/base.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1055">
<caret line="76" column="13" lean-forward="false" selection-start-line="76" selection-start-column="13" selection-end-line="76" selection-end-column="13" />
<folding />
<state relative-caret-position="208">
<caret line="593" column="0" lean-forward="true" selection-start-line="593" selection-start-column="0" selection-end-line="593" selection-end-column="0" />
<folding>
<element signature="e#782#791#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/storage/tasks/storage_tasks.py">
<entry file="file://$PROJECT_DIR$/circle/common/models.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1208">
<caret line="85" column="13" lean-forward="false" selection-start-line="85" selection-start-column="13" selection-end-line="85" selection-end-column="13" />
<folding />
<state relative-caret-position="167">
<caret line="169" column="37" lean-forward="false" selection-start-line="169" selection-start-column="37" selection-end-line="169" selection-end-column="37" />
<folding>
<element signature="e#732#761#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/vm/operations.py">
<entry file="file://$PROJECT_DIR$/circle/vm/models/common.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="69">
<caret line="48" column="0" lean-forward="false" selection-start-line="48" selection-start-column="0" selection-end-line="48" selection-end-column="0" />
<state relative-caret-position="313">
<caret line="118" column="40" lean-forward="false" selection-start-line="118" selection-start-column="17" selection-end-line="118" selection-end-column="40" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/vm.py">
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="69">
<caret line="50" column="0" lean-forward="false" selection-start-line="50" selection-start-column="0" selection-end-line="50" selection-end-column="0" />
<state relative-caret-position="145">
<caret line="208" column="31" lean-forward="true" selection-start-line="208" selection-start-column="31" selection-end-line="208" selection-end-column="31" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/firewall/tasks/local_tasks.py">
<entry file="file://$PROJECT_DIR$/circle/vm/startup.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="571">
<caret line="93" column="13" lean-forward="false" selection-start-line="93" selection-start-column="13" selection-end-line="93" selection-end-column="13" />
<state relative-caret-position="34">
<caret line="2" column="0" lean-forward="false" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="0" />
<folding>
<element signature="e#732#761#0" expanded="false" />
<element signature="e#0#32#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/firewall/tasks/remote_tasks.py">
<entry file="file://$PROJECT_DIR$/circle/vm/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="69">
<caret line="18" column="0" lean-forward="true" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" />
<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>
<entry file="file://$PROJECT_DIR$/circle/vm/tasks/net_tasks.py">
<entry file="file://$PROJECT_DIR$/circle/common/operations.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="425">
<caret line="25" column="13" lean-forward="false" selection-start-line="25" selection-start-column="13" selection-end-line="25" selection-end-column="13" />
<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>
<entry file="file://$PROJECT_DIR$/circle/vm/tasks/local_tasks.py">
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/home.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="409">
<caret line="39" column="13" lean-forward="false" selection-start-line="39" selection-start-column="13" selection-end-line="39" selection-end-column="13" />
<state relative-caret-position="170">
<caret line="58" column="25" lean-forward="false" selection-start-line="58" selection-start-column="14" selection-end-line="58" selection-end-column="25" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/vm/tasks/vm_tasks.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2840">
<caret line="184" column="13" lean-forward="false" selection-start-line="184" selection-start-column="13" selection-end-line="184" selection-end-column="13" />
<folding>
<element signature="e#732#767#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/manager/leasemanager.py">
<entry file="file://$PROJECT_DIR$/circle/vm/models/instance.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="68">
<caret line="4" column="22" lean-forward="false" selection-start-line="4" selection-start-column="22" selection-end-line="4" selection-end-column="22" />
<state relative-caret-position="213">
<caret line="19" column="0" lean-forward="false" selection-start-line="19" selection-start-column="0" selection-end-line="19" selection-end-column="30" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/circle/settings/local.py">
<entry file="file://$PROJECT_DIR$/circle/request/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="85">
<caret line="5" column="42" lean-forward="false" selection-start-line="5" selection-start-column="42" selection-end-line="5" selection-end-column="42" />
<state relative-caret-position="446">
<caret line="58" column="32" lean-forward="false" selection-start-line="58" selection-start-column="32" selection-end-line="58" selection-end-column="32" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/vm/tasks.py">
<entry file="file://$PROJECT_DIR$/circle/dashboard/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="102">
<caret line="6" column="28" lean-forward="true" selection-start-line="0" selection-start-column="0" selection-end-line="6" selection-end-column="28" />
<folding />
<state relative-caret-position="116">
<caret line="68" column="17" lean-forward="false" selection-start-line="68" selection-start-column="17" selection-end-line="68" selection-end-column="17" />
<folding>
<element signature="e#732#770#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/vm/tasks/__init__.py">
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/vm.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="17" lean-forward="false" selection-start-line="0" selection-start-column="17" selection-end-line="0" selection-end-column="17" />
<state relative-caret-position="4">
<caret line="722" column="24" lean-forward="false" selection-start-line="722" selection-start-column="24" selection-end-line="722" selection-end-column="24" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/vm/__init__.py">
<entry file="file://$PROJECT_DIR$/circle/vm/operations.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="17">
<caret line="1" column="0" lean-forward="true" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
<state relative-caret-position="318">
<caret line="668" column="42" lean-forward="false" selection-start-line="668" selection-start-column="42" selection-end-line="668" selection-end-column="42" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/vm/tasks/test.py">
<entry file="file://$PROJECT_DIR$/circle/vm/tasks/lease_tasks.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="68">
<caret line="4" column="33" lean-forward="true" selection-start-line="4" selection-start-column="33" selection-end-line="4" selection-end-column="33" />
<folding />
<state relative-caret-position="463">
<caret line="47" column="57" lean-forward="false" selection-start-line="47" selection-start-column="57" selection-end-line="47" selection-end-column="57" />
<folding>
<element signature="e#0#43#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/celery">
<entry file="file://$PROJECT_DIR$/circle/request/templates/request/_request-lease-form.html">
<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" />
<state relative-caret-position="51">
<caret line="3" column="62" lean-forward="false" selection-start-line="3" selection-start-column="62" selection-end-line="3" selection-end-column="62" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/circle/settings/base.py">
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/_vm-renew.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="363">
<caret line="408" column="27" lean-forward="false" selection-start-line="408" selection-start-column="27" selection-end-line="408" selection-end-column="27" />
<state relative-caret-position="204">
<caret line="12" column="33" lean-forward="false" selection-start-line="12" selection-start-column="33" selection-end-line="12" selection-end-column="33" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.gitignore">
<entry file="file://$PROJECT_DIR$/circle/vm/models/vm_lease.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="523">
<caret line="47" column="13" lean-forward="false" selection-start-line="47" selection-start-column="13" selection-end-line="47" selection-end-column="13" />
<folding />
<state relative-caret-position="364">
<caret line="31" column="58" lean-forward="false" selection-start-line="31" selection-start-column="58" selection-end-line="31" selection-end-column="58" />
<folding>
<element signature="e#0#72#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
......
No preview for this file type
......@@ -2,8 +2,11 @@
"admin": "is_admin:True or (role:admin and is_admin_project:True)",
"owner": "project_id:%(project_id)s",
"circle_admin": "role:circle_admin and project_id:%(project_id)s",
"default": "rule:admin",
"template:create": "rule:admin or rule:owner or rule:circle_admin",
"request:decide": "rule:admin or rule:circle_admin"
"request:decide": "rule:admin or rule:circle_admin",
"lease:manage": "rule:admin or rule:circle_admin"
}
\ No newline at end of file
......@@ -593,7 +593,17 @@ DEFAULT_PUBLIC_ROUTER_NAME_FOR_USER = "default_public"
DEFAULT_PUBLIC_ROUTED_NET_NAME_FOR_USER = "default_public_routed"
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN="bme"
OPENSTACK_KEYSTONE_URL="https://oscircle.guest.ik.bme.hu:5000"
OPENSTACK_KEYSTONE_URL="https://oscircle.guest.ik.bme.hu:5000/v3"
WEBSSO_ENABLED = True #TODO: it is always enabled, refactor openstack_auth
OPENSTACK_SSL_NO_VERIFY = True
OPENSTACK_CIRCLE_DOMAIN_ID = "0cfb6010abcc405ebd19eb5b8f72949d"
OPENSTACK_CIRCLE_USERID = "97980e2747994acba7982d3262c1f3e2"
OPENSTACK_CIRCLE_PASSWORD = "a"
OPENSTACK_INTERFACE = "public"
DEFAULT_LEASE_NAME = "default"
DEFAULT_LEASE_SUSPEND_SECONDS = 3600
DEFAULT_LEASE_DELETE_SECONDS = 7200
......@@ -10,7 +10,7 @@
</a>
{% if object.active and lease_types and not request.token_user %}
<a class="btn btn-primary" id="vm-renew-request-lease-button"
href="{% url "request.views.request-lease" vm_pk=object.pk %}">
href="{% url "request.views.request-lease" vm_pk=object.id %}">
<i class="fa fa-forward"></i>
{% trans "Request longer lease" %}
</a>
......
......@@ -6,7 +6,6 @@
{% block content %}
<div class="row">
<div class="col-md-7">
<div class="panel panel-default">
<div class="panel-heading">
<a class="pull-right btn btn-default btn-xs" href="{% url "dashboard.views.template-list" %}">{% trans "Back" %}</a>
......@@ -19,86 +18,6 @@
{% crispy form %}
</div>
</div>
</div>
<div class="col-md-5">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="no-margin"><i class="icon-group"></i> {% trans "Manage access" %}</h4>
</div>
<div class="panel-body">
<form action="{% url "dashboard.views.lease-acl" pk=object.pk %}" method="post">{% csrf_token %}
<table class="table table-striped table-with-form-fields" id="template-access-table">
<thead>
<tr>
<th></th>
<th>{% trans "Who" %}</th>
<th>{% trans "What" %}</th>
<th><i class="icon-remove"></i></th>
</tr>
</thead>
<tbody>
{% for i in acl.users %}
<tr>
<td>
<i class="icon-user"></i>
</td>
<td>
<a href="{% url "dashboard.views.profile" username=i.user.username %}"
title="{{ i.user.username }}">
{% include "dashboard/_display-name.html" with user=i.user show_org=True %}
</a>
</td>
<td>
<select class="form-control" name="perm-u-{{i.user.id}}">
{% for id, name in acl.levels %}
<option{%if id == i.level%} selected="selected"{%endif%} value="{{id}}">{{name}}</option>
{% endfor %}
</select>
</td>
<td>
<input type="checkbox" name="remove-u-{{i.user.id}}" title="{% trans "Remove" %}"/>
</td>
</tr>
{% endfor %}
{% for i in acl.groups %}
<tr>
<td><i class="icon-group"></i></td>
<td>
<a href="{% url "dashboard.views.group-detail" pk=i.group.pk %}">
{{i.group}}
</a>
</td>
<td>
<select class="form-control" name="perm-g-{{i.group.id}}">
{% for id, name in acl.levels %}
<option{%if id == i.level%} selected="selected"{%endif%} value="{{id}}">{{name}}</option>
{% endfor %}
</select>
</td>
<td>
<input type="checkbox" name="remove-g-{{i.group.id}}" title="{% trans "Remove" %}"/>
</td>
</tr>
{% endfor %}
<tr><td><i class="icon-plus"></i></td>
<td><input type="text" class="form-control" name="name"
placeholder="{% trans "Name of group or user" %}"></td>
<td><select class="form-control" name="level">
{% for id, name in acl.levels %}
<option value="{{id}}">{{name}}</option>
{% endfor %}
</select></td><td></td>
</tr>
</tbody>
</table>
<div class="form-actions">
<button type="submit" class="btn btn-success">{% trans "Save" %}</button>
</div>
</form>
</div>
</div>
</div>
</div>
{% endblock %}
......@@ -47,12 +47,10 @@
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
{% if perms.vm.create_leases %}
<a href="{% url "dashboard.views.lease-create" %}"
class="pull-right btn btn-success btn-xs" style="margin-right: 10px;">
<i class="fa fa-plus"></i> {% trans "new lease" %}
</a>
{% endif %}
<h3 class="no-margin"><i class="fa fa-clock-o"></i> {% trans "Leases" %}</h3>
</div>
<div class="panel-body">
......
......@@ -56,7 +56,7 @@
<div id="home_expiration_and_lease">
<h4>
{% trans "Expiration" %}
{# {% if instance.is_expiring %}<i class="fa fa-warning-sign text-danger"></i>{% endif %}#}
{% if is_expiring %}<i class="fa fa-warning-sign text-danger"></i>{% endif %}
<span id="vm-details-renew-op">
{% with op=op.renew %}{% if op %}
<a href="{{op.get_url}}" class="btn btn-xs operation operation-{{ op.op }}
......@@ -70,14 +70,14 @@
<dl>
<dt>{% trans "Suspended at:" %}</dt>
<dd>
<span title="{{ instance.time_of_suspend }}">
<i class="fa fa-moon-o"></i> {{ instance.time_of_suspend|arrowfilter:LANGUAGE_CODE }}
<span title="{{ time_of_suspend }}">
<i class="fa fa-moon-o"></i> {{ time_of_suspend|arrowfilter:LANGUAGE_CODE }}
</span>
</dd>
<dt>{% trans "Destroyed at:" %}</dt>
<dd>
<span title="{{ instance.time_of_delete }}">
<i class="fa fa-times"></i> {{ instance.time_of_delete|arrowfilter:LANGUAGE_CODE }}
<span title="{{ time_of_delete }}">
<i class="fa fa-times"></i> {{ time_of_delete|arrowfilter:LANGUAGE_CODE }}
</span>
</dd>
</dl>
......
......@@ -19,7 +19,7 @@ from __future__ import absolute_import
from dashboard.views.autocomplete import AclUserGroupAutocomplete, AclUserAutocomplete
from dashboard.views.template import TemplateList, TemplateChoose, TemplateDetail, TemplateDelete, \
TransferTemplateOwnershipConfirmView, TransferTemplateOwnershipView
TransferTemplateOwnershipConfirmView, TransferTemplateOwnershipView, LeaseCreate, LeaseDetail, LeaseDelete
from dashboard.views.vm import VmDetailView, VmList, VmCreate, vm_activity, vm_ops, FavouriteView, VmPlainImageCreate
from django.conf.urls import url
......@@ -34,12 +34,12 @@ urlpatterns = [
# url(r'^profile/create/$',
# UserCreationView.as_view(),
# name="dashboard.views.user-create"),
# url(r'^lease/(?P<pk>\d+)/$', LeaseDetail.as_view(),
# name="dashboard.views.lease-detail"),
# url(r'^lease/create/$', LeaseCreate.as_view(),
# name="dashboard.views.lease-create"),
# url(r'^lease/delete/(?P<pk>\d+)/$', LeaseDelete.as_view(),
# name="dashboard.views.lease-delete"),
url(r'^lease/(?P<pk>\d+)/$', LeaseDetail.as_view(),
name="dashboard.views.lease-detail"),
url(r'^lease/create/$', LeaseCreate.as_view(),
name="dashboard.views.lease-create"),
url(r'^lease/delete/(?P<pk>\d+)/$', LeaseDelete.as_view(),
name="dashboard.views.lease-delete"),
# url(r'^lease/(?P<pk>\d+)/acl/$', LeaseAclUpdateView.as_view(),
# name="dashboard.views.lease-acl"),
#
......
......@@ -21,6 +21,7 @@ import json
import logging
import openstack_api
from braces.views._access import AccessMixin
from django.contrib import messages
from django.contrib.auth.models import User
from django.contrib.messages.views import SuccessMessageMixin
......@@ -197,16 +198,19 @@ class TemplateList(LoginRequiredMixin, FilterMixin, SingleTableView):
def get_context_data(self, *args, **kwargs):
context = super(TemplateList, self).get_context_data(*args, **kwargs)
user = self.request.user
# leases_w_operator = Lease.get_objects_with_level("operator", user)
# context['lease_table'] = LeaseListTable(
# leases_w_operator, request=self.request,
# template="django_tables2/table_no_page.html",
# )
context['show_lease_table'] = (
# leases_w_operator.count() > 0 or
# user.has_perm("vm.create_leases")
False
from django.utils.module_loading import import_string
check = import_string("openstack_auth.policy.check")
os_policy_actions = (("circle", "lease:manage"),)
has_lease_rights = check(os_policy_actions, self.request)
leases = Lease.objects.all()
context['lease_table'] = LeaseListTable(
leases, request=self.request,
template="django_tables2/table_no_page.html",
)
context['show_lease_table'] = has_lease_rights
context['search_form'] = self.search_form
......@@ -382,86 +386,80 @@ class TemplateDetail(LoginRequiredMixin, GraphMixin, SuccessMessageMixin, Update
# def get_success_url(self):
# return self.request.POST.get("next") or "/"
class PolicyMixin(AccessMixin):
os_policy_actions = None
def has_permission(self):
if self.os_policy_actions:
from django.utils.module_loading import import_string
check = import_string("openstack_auth.policy.check")
return check(self.os_policy_actions, self.request)
return False
class LeaseCreate(LoginRequiredMixin, PermissionRequiredMixin,
def dispatch(self, request, *args, **kwargs):
if not self.has_permission():
return self.handle_no_permission(request)
return super(PolicyMixin, self).dispatch(request, *args, **kwargs)
class LeaseCreate(LoginRequiredMixin, PolicyMixin,
SuccessMessageMixin, CreateView):
model = Lease
form_class = LeaseForm
permission_required = 'vm.create_leases'
template_name = "dashboard/lease-create.html"
success_message = _("Successfully created a new lease.")
os_policy_actions = (("circle", "lease:manage"),)
def get_success_url(self):
return reverse_lazy("dashboard.views.template-list")
def form_valid(self, form):
retval = super(LeaseCreate, self).form_valid(form)
self.object.set_level(self.request.user, "owner")
return retval
class LeaseAclUpdateView(AclUpdateView):
model = Lease
# class LeaseAclUpdateView(AclUpdateView):
# model = Lease
class LeaseDetail(LoginRequiredMixin, SuccessMessageMixin, UpdateView):
class LeaseDetail(LoginRequiredMixin, PolicyMixin,
SuccessMessageMixin, UpdateView):
model = Lease
form_class = LeaseForm
template_name = "dashboard/lease-edit.html"
success_message = _("Successfully modified lease.")
def get_context_data(self, *args, **kwargs):
obj = self.get_object()
context = super(LeaseDetail, self).get_context_data(*args, **kwargs)
context['acl'] = AclUpdateView.get_acl_data(
obj, self.request.user, 'dashboard.views.lease-acl')
return context
os_policy_actions = (("circle", "lease:manage"),)
def get_success_url(self):
return reverse_lazy("dashboard.views.lease-detail", kwargs=self.kwargs)
def get(self, request, *args, **kwargs):
if not self.get_object().has_level(request.user, "owner"):
message = _("Only the owners can modify the selected lease.")
messages.warning(request, message)
return redirect(reverse_lazy("dashboard.views.template-list"))
return super(LeaseDetail, self).get(request, *args, **kwargs)
def post(self, request, *args, **kwargs):
if not self.get_object().has_level(request.user, "owner"):
raise PermissionDenied()
class LeaseDelete(DeleteViewBase):
model = Lease
success_message = _("Lease successfully deleted.")
os_policy_actions = (("circle", "lease:manage"),)
def get_success_url(self):
return reverse("dashboard.views.template-list")
def get_context_data(self, *args, **kwargs):
c = super(LeaseDelete, self).get_context_data(*args, **kwargs)
lease = self.get_object()
templates = lease.instancetemplate_set
if templates.count() > 0:
text = _("You can't delete this lease because some templates "
"are still using it, modify these to proceed: ")
c['text'] = text + ", ".join("<strong>%s (#%d)</strong>"
"" % (o.name, o.pk)
for o in templates.all())
c['disable_submit'] = True
return c
def delete_obj(self, request, *args, **kwargs):
object = self.get_object()
if object.instancetemplate_set.count() > 0:
raise SuspiciousOperation()
object.delete()
return super(LeaseDetail, self).post(request, *args, **kwargs)
#
# class LeaseDelete(DeleteViewBase):
# model = Lease
# success_message = _("Lease successfully deleted.")
#
# def get_success_url(self):
# return reverse("dashboard.views.template-list")
#
# def get_context_data(self, *args, **kwargs):
# c = super(LeaseDelete, self).get_context_data(*args, **kwargs)
# lease = self.get_object()
# templates = lease.instancetemplate_set
# if templates.count() > 0:
# text = _("You can't delete this lease because some templates "
# "are still using it, modify these to proceed: ")
#
# c['text'] = text + ", ".join("<strong>%s (#%d)</strong>"
# "" % (o.name, o.pk)
# for o in templates.all())
# c['disable_submit'] = True
# return c
#
# def delete_obj(self, request, *args, **kwargs):
# object = self.get_object()
# if object.instancetemplate_set.count() > 0:
# raise SuspiciousOperation()
# object.delete()
#
#
class TransferTemplateOwnershipConfirmView(TransferOwnershipConfirmView):
template = "dashboard/confirm/transfer-template-ownership.html"
model = InstanceTemplate
......
......@@ -725,7 +725,7 @@ class TransferOwnershipConfirmView(LoginRequiredMixin, View):
class DeleteViewBase(LoginRequiredMixin, DeleteView):
level = 'owner'
os_policy_actions = None
def get_template_names(self):
if self.request.is_ajax():
......@@ -734,7 +734,12 @@ class DeleteViewBase(LoginRequiredMixin, DeleteView):
return ['dashboard/confirm/base-delete.html']
def check_auth(self):
if not self.get_object().has_level(self.request.user, self.level):
from django.utils.module_loading import import_string
check = import_string("openstack_auth.policy.check")
has_rights = check(self.os_policy_actions, self.request,
{'project_id': self.request.user.tenant_id})
if not has_rights:
raise PermissionDenied()
def get(self, request, *args, **kwargs):
......
......@@ -50,12 +50,13 @@ from firewall.models import Vlan, Host, Rule
# from manager.scheduler import SchedulerError
from network.models import DefaultPublicRouter, DefaultPublicRoutedNet
from openstack_api.nova import Server
from request.forms import TemplateRequestForm
from request.models import TemplateAccessType
from request.forms import TemplateRequestForm, LeaseRequestForm
from request.models import TemplateAccessType, LeaseType
from storage.models import Disk
from vm.models import (
Instance, InstanceActivity, Interface,
InstanceTemplate)
InstanceTemplate, Lease)
from vm.models.vm_lease import VmLease
from .util import (
CheckedDetailView, AjaxOperationMixin, OperationView, AclUpdateView,
......@@ -63,7 +64,7 @@ from .util import (
)
from ..forms import (
AclUserOrGroupAddForm, VmResourcesForm, VmCustomizeForm, VmDeployForm, VmFromPlainImageForm, VmRemoveInterfaceForm,
VmAddInterfaceForm, VmSaveForm, VmPortAddForm, VmPublicIpAddForm, VmPublicIpRemoveForm)
VmAddInterfaceForm, VmSaveForm, VmPortAddForm, VmPublicIpAddForm, VmPublicIpRemoveForm, VmRenewForm)
logger = logging.getLogger(__name__)
......@@ -141,6 +142,15 @@ class VmDetailView(LoginRequiredMixin, GraphMixin, DetailView):
'instance': self.object
})
vm_lease = VmLease.get_or_create_lease(instance.id)
context.update({
'time_of_suspend': vm_lease.time_of_suspend,
'time_of_delete': vm_lease.time_of_delete,
'is_expiring': vm_lease.is_delete_expiring() or
vm_lease.is_suspend_expiring() and instance.status is "ACTIVE",
})
# activity data
# activities = instance.get_merged_activities(user)
# show_show_all = len(activities) > 10
......@@ -705,40 +715,39 @@ class VmSaveView(FormOperationMixin, VmOperationView):
# return user
#
#
# class VmRenewView(FormOperationMixin, TokenOperationView, VmOperationView):
#
# op = 'renew'
# icon = 'calendar'
# effect = 'success'
# show_in_toolbar = False
# form_class = VmRenewForm
# wait_for_result = 0.5
# template_name = 'dashboard/_vm-renew.html'
# with_reload = True
#
# def get_form_kwargs(self):
# choices = Lease.get_objects_with_level("user", self.request.user)
# default = self.get_op().instance.lease
# if default and default not in choices:
# choices = (choices.distinct() |
# Lease.objects.filter(pk=default.pk).distinct())
#
# val = super(VmRenewView, self).get_form_kwargs()
# val.update({'choices': choices, 'default': default})
# return val
#
# def get_response_data(self, result, done, extra=None, **kwargs):
# extra = super(VmRenewView, self).get_response_data(result, done,
# extra, **kwargs)
# extra["new_suspend_time"] = unicode(self.get_op().
# instance.time_of_suspend)
# return extra
#
# def get_context_data(self, **kwargs):
# context = super(VmRenewView, self).get_context_data(**kwargs)
# context['lease_request_form'] = LeaseRequestForm(request=self.request)
# context['lease_types'] = LeaseType.objects.exists()
# return context
class VmRenewView(FormOperationMixin, VmOperationView):
op = 'renew'
icon = 'calendar'
effect = 'success'
show_in_toolbar = False
form_class = VmRenewForm
template_name = 'dashboard/_vm-renew.html'
def get_form_kwargs(self):
choices = Lease.objects.all() #TODO: filter on permissions
instance = self.get_op().instance
default = VmLease.objects.get(os_server_id=instance.id).lease
# if default and default not in choices:
# choices = (choices.distinct() |
# Lease.objects.filter(pk=default.pk).distinct())
val = super(VmRenewView, self).get_form_kwargs()
val.update({'choices': choices, 'default': default})
return val
def get_response_data(self, result, done, extra=None, **kwargs):
extra = super(VmRenewView, self).get_response_data(result, done,
extra, **kwargs)
instance = self.get_op().instance
time_of_suspend = VmLease.objects.get(os_server_id=instance.id).time_of_suspend
extra["new_suspend_time"] = unicode(time_of_suspend)
return extra
def get_context_data(self, **kwargs):
context = super(VmRenewView, self).get_context_data(**kwargs)
context['lease_request_form'] = LeaseRequestForm(request=self.request)
context['lease_types'] = LeaseType.objects.exists()
return context
#
#
# class VmStateChangeView(FormOperationMixin, VmOperationView):
......@@ -844,7 +853,7 @@ vm_ops = OrderedDict([
# ('add_port', VmPortAddView),
('add_public_ip', VmPublicIpAddView),
('remove_public_ip', VmPublicIpRemoveView),
# ('renew', VmRenewView),
('renew', VmRenewView),
# ('resources_change', VmResourcesChangeView),
# ('password_reset', VmOperationView.factory(
# op='password_reset', icon='unlock', effect='warning',
......
......@@ -30,13 +30,12 @@ from keystoneclient import exceptions as keystone_exceptions
from openstack_auth import backend
from openstack_auth import utils as auth_utils
from horizon import exceptions
from horizon import messages
from horizon.utils import functions as utils
import exceptions
import messages
from utils import functions as utils
from openstack_dashboard.api import base
from openstack_dashboard.contrib.developer.profiler import api as profiler
from openstack_dashboard import policy
import base
import policy
LOG = logging.getLogger(__name__)
......@@ -199,7 +198,7 @@ def keystoneclient(request, admin=False):
return conn
@profiler.trace
def domain_create(request, name, description=None, enabled=None):
manager = keystoneclient(request, admin=True).domains
return manager.create(name=name,
......@@ -207,19 +206,19 @@ def domain_create(request, name, description=None, enabled=None):
enabled=enabled)
@profiler.trace
def domain_get(request, domain_id):
manager = keystoneclient(request, admin=True).domains
return manager.get(domain_id)
@profiler.trace
def domain_delete(request, domain_id):
manager = keystoneclient(request, admin=True).domains
return manager.delete(domain_id)
@profiler.trace
def domain_list(request):
manager = keystoneclient(request, admin=True).domains
return manager.list()
......@@ -239,7 +238,7 @@ def domain_lookup(request):
return {domain.id: domain.name}
@profiler.trace
def domain_update(request, domain_id, name=None, description=None,
enabled=None):
manager = keystoneclient(request, admin=True).domains
......@@ -252,7 +251,7 @@ def domain_update(request, domain_id, name=None, description=None,
return response
@profiler.trace
def tenant_create(request, name, description=None, enabled=None,
domain=None, **kwargs):
manager = VERSIONS.get_project_manager(request, admin=True)
......@@ -335,7 +334,7 @@ def is_domain_admin(request):
# A quick search through the codebase reveals that it's always called with
# admin=true so I suspect we could eliminate it entirely as with the other
# tenant commands.
@profiler.trace
def tenant_get(request, project, admin=True):
manager = VERSIONS.get_project_manager(request, admin=admin)
try:
......@@ -345,13 +344,13 @@ def tenant_get(request, project, admin=True):
raise
@profiler.trace
def tenant_delete(request, project):
manager = VERSIONS.get_project_manager(request, admin=True)
return manager.delete(project)
@profiler.trace
def tenant_list(request, paginate=False, marker=None, domain=None, user=None,
admin=True, filters=None):
manager = VERSIONS.get_project_manager(request, admin=admin)
......@@ -394,7 +393,7 @@ def tenant_list(request, paginate=False, marker=None, domain=None, user=None,
return tenants, has_more_data
@profiler.trace
def tenant_update(request, project, name=None, description=None,
enabled=None, domain=None, **kwargs):
manager = VERSIONS.get_project_manager(request, admin=True)
......@@ -409,7 +408,7 @@ def tenant_update(request, project, name=None, description=None,
raise exceptions.Conflict()
@profiler.trace
def user_list(request, project=None, domain=None, group=None, filters=None):
users = []
if VERSIONS.active < 3:
......@@ -432,7 +431,7 @@ def user_list(request, project=None, domain=None, group=None, filters=None):
return [VERSIONS.upgrade_v2_user(user) for user in users]
@profiler.trace
def user_create(request, name=None, email=None, password=None, project=None,
enabled=None, domain=None, description=None, **data):
manager = keystoneclient(request, admin=True).users
......@@ -449,18 +448,18 @@ def user_create(request, name=None, email=None, password=None, project=None,
raise exceptions.Conflict()
@profiler.trace
def user_delete(request, user_id):
return keystoneclient(request, admin=True).users.delete(user_id)
@profiler.trace
def user_get(request, user_id, admin=True):
user = keystoneclient(request, admin=admin).users.get(user_id)
return VERSIONS.upgrade_v2_user(user)
@profiler.trace
def user_update(request, user, **data):
manager = keystoneclient(request, admin=True).users
error = None
......@@ -509,7 +508,7 @@ def user_update(request, user, **data):
raise exceptions.Conflict()
@profiler.trace
def user_update_enabled(request, user, enabled):
manager = keystoneclient(request, admin=True).users
if VERSIONS.active < 3:
......@@ -518,7 +517,7 @@ def user_update_enabled(request, user, enabled):
return manager.update(user, enabled=enabled)
@profiler.trace
def user_update_password(request, user, password, admin=True):
if not keystone_can_edit_user():
......@@ -553,7 +552,7 @@ def user_verify_admin_password(request, admin_password):
return False
@profiler.trace
def user_update_own_password(request, origpassword, password):
client = keystoneclient(request, admin=False)
client.user_id = request.user.id
......@@ -563,7 +562,7 @@ def user_update_own_password(request, origpassword, password):
return client.users.update_password(origpassword, password)
@profiler.trace
def user_update_tenant(request, user, project, admin=True):
manager = keystoneclient(request, admin=admin).users
if VERSIONS.active < 3:
......@@ -572,7 +571,7 @@ def user_update_tenant(request, user, project, admin=True):
return manager.update(user, project=project)
@profiler.trace
def group_create(request, domain_id, name, description=None):
manager = keystoneclient(request, admin=True).groups
return manager.create(domain=domain_id,
......@@ -580,19 +579,19 @@ def group_create(request, domain_id, name, description=None):
description=description)
@profiler.trace
def group_get(request, group_id, admin=True):
manager = keystoneclient(request, admin=admin).groups
return manager.get(group_id)
@profiler.trace
def group_delete(request, group_id):
manager = keystoneclient(request, admin=True).groups
return manager.delete(group_id)
@profiler.trace
def group_list(request, domain=None, project=None, user=None, filters=None):
manager = keystoneclient(request, admin=True).groups
groups = []
......@@ -621,7 +620,7 @@ def group_list(request, domain=None, project=None, user=None, filters=None):
return groups
@profiler.trace
def group_update(request, group_id, name=None, description=None):
manager = keystoneclient(request, admin=True).groups
return manager.update(group=group_id,
......@@ -629,13 +628,13 @@ def group_update(request, group_id, name=None, description=None):
description=description)
@profiler.trace
def add_group_user(request, group_id, user_id):
manager = keystoneclient(request, admin=True).users
return manager.add_to_group(group=group_id, user=user_id)
@profiler.trace
def remove_group_user(request, group_id, user_id):
manager = keystoneclient(request, admin=True).users
return manager.remove_from_group(group=group_id, user=user_id)
......@@ -669,7 +668,7 @@ def get_project_groups_roles(request, project):
return groups_roles
@profiler.trace
def role_assignments_list(request, project=None, user=None, role=None,
group=None, domain=None, effective=False,
include_subtree=True, include_names=False):
......@@ -687,31 +686,31 @@ def role_assignments_list(request, project=None, user=None, role=None,
include_names=include_names)
@profiler.trace
def role_create(request, name):
manager = keystoneclient(request, admin=True).roles
return manager.create(name)
@profiler.trace
def role_get(request, role_id):
manager = keystoneclient(request, admin=True).roles
return manager.get(role_id)
@profiler.trace
def role_update(request, role_id, name=None):
manager = keystoneclient(request, admin=True).roles
return manager.update(role_id, name)
@profiler.trace
def role_delete(request, role_id):
manager = keystoneclient(request, admin=True).roles
return manager.delete(role_id)
@profiler.trace
def role_list(request, filters=None):
"""Returns a global list of available roles."""
manager = keystoneclient(request, admin=True).roles
......@@ -731,7 +730,7 @@ def role_list(request, filters=None):
return roles
@profiler.trace
def roles_for_user(request, user, project=None, domain=None):
"""Returns a list of user roles scoped to a project or domain."""
manager = keystoneclient(request, admin=True).roles
......@@ -741,7 +740,7 @@ def roles_for_user(request, user, project=None, domain=None):
return manager.list(user=user, domain=domain, project=project)
@profiler.trace
def get_domain_users_roles(request, domain):
users_roles = collections.defaultdict(list)
domain_role_assignments = role_assignments_list(request,
......@@ -760,21 +759,21 @@ def get_domain_users_roles(request, domain):
return users_roles
@profiler.trace
def add_domain_user_role(request, user, role, domain):
"""Adds a role for a user on a domain."""
manager = keystoneclient(request, admin=True).roles
return manager.grant(role, user=user, domain=domain)
@profiler.trace
def remove_domain_user_role(request, user, role, domain=None):
"""Removes a given single role for a user from a domain."""
manager = keystoneclient(request, admin=True).roles
return manager.revoke(role, user=user, domain=domain)
@profiler.trace
def get_project_users_roles(request, project):
users_roles = collections.defaultdict(list)
if VERSIONS.active < 3:
......@@ -800,7 +799,7 @@ def get_project_users_roles(request, project):
return users_roles
@profiler.trace
def add_tenant_user_role(request, project=None, user=None, role=None,
group=None, domain=None):
"""Adds a role for a user on a tenant."""
......@@ -812,7 +811,7 @@ def add_tenant_user_role(request, project=None, user=None, role=None,
group=group, domain=domain)
@profiler.trace
def remove_tenant_user_role(request, project=None, user=None, role=None,
group=None, domain=None):
"""Removes a given single role for a user from a tenant."""
......@@ -833,13 +832,13 @@ def remove_tenant_user(request, project=None, user=None, domain=None):
project=project, domain=domain)
@profiler.trace
def roles_for_group(request, group, domain=None, project=None):
manager = keystoneclient(request, admin=True).roles
return manager.list(group=group, domain=domain, project=project)
@profiler.trace
def add_group_role(request, role, group, domain=None, project=None):
"""Adds a role for a group on a domain or project."""
manager = keystoneclient(request, admin=True).roles
......@@ -847,7 +846,7 @@ def add_group_role(request, role, group, domain=None, project=None):
project=project)
@profiler.trace
def remove_group_role(request, role, group, domain=None, project=None):
"""Removes a given single role for a group from a domain or project."""
manager = keystoneclient(request, admin=True).roles
......@@ -855,7 +854,7 @@ def remove_group_role(request, role, group, domain=None, project=None):
domain=domain)
@profiler.trace
def remove_group_roles(request, group, domain=None, project=None):
"""Removes all roles from a group on a domain or project."""
client = keystoneclient(request, admin=True)
......@@ -896,22 +895,22 @@ def ec2_manager(request):
return ec2.CredentialsManager(client)
@profiler.trace
def list_ec2_credentials(request, user_id):
return ec2_manager(request).list(user_id)
@profiler.trace
def create_ec2_credentials(request, user_id, tenant_id):
return ec2_manager(request).create(user_id, tenant_id)
@profiler.trace
def get_user_ec2_credentials(request, user_id, access_token):
return ec2_manager(request).get(user_id, access_token)
@profiler.trace
def delete_user_ec2_credentials(request, user_id, access_token):
return ec2_manager(request).delete(user_id, access_token)
......@@ -977,13 +976,13 @@ def identity_provider_create(request, idp_id, description=None,
raise exceptions.Conflict()
@profiler.trace
def identity_provider_get(request, idp_id):
manager = keystoneclient(request, admin=True).federation.identity_providers
return manager.get(idp_id)
@profiler.trace
def identity_provider_update(request, idp_id, description=None,
enabled=False, remote_ids=None):
manager = keystoneclient(request, admin=True).federation.identity_providers
......@@ -996,19 +995,19 @@ def identity_provider_update(request, idp_id, description=None,
raise exceptions.Conflict()
@profiler.trace
def identity_provider_delete(request, idp_id):
manager = keystoneclient(request, admin=True).federation.identity_providers
return manager.delete(idp_id)
@profiler.trace
def identity_provider_list(request):
manager = keystoneclient(request, admin=True).federation.identity_providers
return manager.list()
@profiler.trace
def mapping_create(request, mapping_id, rules):
manager = keystoneclient(request, admin=True).federation.mappings
try:
......@@ -1017,31 +1016,31 @@ def mapping_create(request, mapping_id, rules):
raise exceptions.Conflict()
@profiler.trace
def mapping_get(request, mapping_id):
manager = keystoneclient(request, admin=True).federation.mappings
return manager.get(mapping_id)
@profiler.trace
def mapping_update(request, mapping_id, rules):
manager = keystoneclient(request, admin=True).federation.mappings
return manager.update(mapping_id, rules=rules)
@profiler.trace
def mapping_delete(request, mapping_id):
manager = keystoneclient(request, admin=True).federation.mappings
return manager.delete(mapping_id)
@profiler.trace
def mapping_list(request):
manager = keystoneclient(request, admin=True).federation.mappings
return manager.list()
@profiler.trace
def protocol_create(request, protocol_id, identity_provider, mapping):
manager = keystoneclient(request).federation.protocols
try:
......@@ -1050,25 +1049,25 @@ def protocol_create(request, protocol_id, identity_provider, mapping):
raise exceptions.Conflict()
@profiler.trace
def protocol_get(request, identity_provider, protocol):
manager = keystoneclient(request).federation.protocols
return manager.get(identity_provider, protocol)
@profiler.trace
def protocol_update(request, identity_provider, protocol, mapping):
manager = keystoneclient(request).federation.protocols
return manager.update(identity_provider, protocol, mapping)
@profiler.trace
def protocol_delete(request, identity_provider, protocol):
manager = keystoneclient(request).federation.protocols
return manager.delete(identity_provider, protocol)
@profiler.trace
def protocol_list(request, identity_provider):
manager = keystoneclient(request).federation.protocols
return manager.list(identity_provider)
{% load i18n %}
{% load crispy_forms_tags %}
<form action="{% url "request.views.request-lease" vm_pk=vm.pk %}" method="POST">
<form action="{% url "request.views.request-lease" vm_pk=vm.id %}" method="POST">
{% include "display-form-errors.html" %}
{% csrf_token %}
{{ form.lease|as_crispy_field }}
......
# noqa
default_app_config = 'vm.startup.DefaultLeaseConfig'
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-05-15 09:51
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('vm', '0011_auto_20180420_1054'),
]
operations = [
migrations.CreateModel(
name='VmLease',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('os_server_id', models.CharField(max_length=100, unique=True)),
('time_of_suspend', models.DateTimeField(blank=True, default=None, help_text='Proposed time of automatic suspension.', null=True, verbose_name='time of suspend')),
('time_of_delete', models.DateTimeField(blank=True, default=None, help_text='Proposed time of automatic deletion.', null=True, verbose_name='time of delete')),
('lease', models.ForeignKey(help_text='Preferred expiration periods.', on_delete=django.db.models.deletion.CASCADE, to='vm.Lease', verbose_name='Lease')),
],
),
migrations.AddField(
model_name='instancetemplate',
name='lease',
field=models.ForeignKey(default=0, help_text='Preferred expiration periods.', on_delete=django.db.models.deletion.CASCADE, to='vm.Lease', verbose_name='Lease'),
preserve_default=False,
),
]
......@@ -163,3 +163,4 @@ class Trait(Model):
self.instance_set.exists() or self.node_set.exists() or
self.instancetemplate_set.exists()
)
......@@ -29,7 +29,7 @@ from django.core import signing
from django.core.exceptions import PermissionDenied
from django.db.models import (BooleanField, CharField, DateTimeField,
IntegerField, ForeignKey, Manager,
ManyToManyField, permalink, SET_NULL, TextField)
ManyToManyField, permalink, SET_NULL, TextField, Model)
from django.db import IntegrityError
from django.dispatch import Signal
from django.utils import timezone
......@@ -53,7 +53,6 @@ from .common import BaseResourceConfigModel, Lease
from .network import Interface
from network.models import EditorElement
from openstack_auth.user import User
logger = getLogger(__name__)
......@@ -95,7 +94,6 @@ def find_unused_vnc_port():
class VirtualMachineDescModel(BaseResourceConfigModel):
"""Abstract base for virtual machine describing models.
"""
access_method = CharField(max_length=10, choices=ACCESS_METHODS,
......@@ -134,8 +132,8 @@ class InstanceTemplate(TimeStampedModel):
# disks = ManyToManyField('storage.Disk', verbose_name=_('disks'),
# related_name='template_set',
# help_text=_('Disks which are to be mounted.'))
# lease = ForeignKey(Lease, help_text=_("Preferred expiration periods."),
# verbose_name=_("Lease"))
lease = ForeignKey(Lease, help_text=_("Preferred expiration periods."),
verbose_name=_("Lease"))
image_id = CharField(blank=False, max_length=100)
flavor_id = CharField(blank=False, max_length=100)
owner_id = CharField(blank=False, max_length=100)
......@@ -143,7 +141,7 @@ class InstanceTemplate(TimeStampedModel):
class Meta:
app_label = 'vm'
db_table = 'vm_instancetemplate'
ordering = ('name', )
ordering = ('name',)
verbose_name = _('template')
verbose_name_plural = _('templates')
......@@ -152,13 +150,13 @@ class InstanceTemplate(TimeStampedModel):
@property
def running_instances(self):
return 0 #TODO: see get_running_instances
return 0 # TODO: see get_running_instances
@property
def os_type(self):
"""The type of the template's operating system.
"""
return 'linux' #TODO
return 'linux' # TODO
if self.access_method == 'rdp':
return 'windows'
else:
......@@ -169,25 +167,24 @@ class InstanceTemplate(TimeStampedModel):
return ('dashboard.views.template-detail', None, {'pk': self.pk})
def remove_disk(self, disk, **kwargs):
#TODO: why?
# TODO: why?
self.disks.remove(disk)
def destroy_disks(self):
#TODO: why?
# TODO: why?
for disk in self.disks.all():
disk.destroy()
def get_running_instances(self):
return () #TODO: do we need this? if so, store created vm ids in template
return () # TODO: do we need this? if so, store created vm ids in template
@property
def metric_prefix(self):
#TODO: what is this?
# TODO: what is this?
return 'template.%d' % self.pk
class Instance(OperatedMixin, TimeStampedModel):
"""Virtual machine instance.
"""
STATUS = Choices(
......@@ -237,7 +234,7 @@ class Instance(OperatedMixin, TimeStampedModel):
class Meta:
app_label = 'vm'
db_table = 'vm_instance'
ordering = ('pk', )
ordering = ('pk',)
permissions = (
('access_console', _('Can access the graphical console of a VM.')),
('change_resources', _('Can change resources of a running VM.')),
......@@ -506,7 +503,7 @@ class Instance(OperatedMixin, TimeStampedModel):
def get_connect_port(self, use_ipv6=False):
"""Get public port number for default access method.
"""
return None #TODO
return None # TODO
port, proto = ACCESS_PROTOCOLS[self.access_method][1:3]
if self.primary_host:
......
from django.db.models import Model, ForeignKey, CharField, DateTimeField
from django.conf import settings
from django.utils import timezone
from vm.models import Lease
from django.utils.translation import ugettext_lazy as _
from datetime import timedelta
class VmLease(Model):
lease = ForeignKey(Lease, help_text=_("Preferred expiration periods."),
verbose_name=_("Lease"))
os_server_id = CharField(blank=False, max_length=100, unique=True)
time_of_suspend = DateTimeField(blank=True, default=None, null=True,
verbose_name=_('time of suspend'),
help_text=_("Proposed time of automatic "
"suspension."))
time_of_delete = DateTimeField(blank=True, default=None, null=True,
verbose_name=_('time of delete'),
help_text=_("Proposed time of automatic "
"deletion."))
def get_renew_times(self, lease=None):
"""Returns new suspend and delete times if renew would be called.
"""
if lease is None:
lease = self.lease
return (
timezone.now() + lease.suspend_interval,
timezone.now() + lease.delete_interval)
def clean(self, *args, **kwargs):
self.time_of_suspend, self.time_of_delete = self.get_renew_times()
super(VmLease, self).clean(*args, **kwargs)
def is_suspend_expiring(self, threshold=0.1):
limit = timezone.now() + timedelta(seconds=(
threshold * self.lease.suspend_interval.total_seconds()))
return limit > self.time_of_suspend
def is_delete_expiring(self, threshold=0.1):
limit = timezone.now() + timedelta(seconds=(
threshold * self.lease.delete_interval.total_seconds()))
return limit > self.time_of_delete
@classmethod
def get_or_create_lease(cls, server_id):
try:
return VmLease.objects.get(os_server_id=server_id)
except VmLease.DoesNotExist:
lease = VmLease(
os_server_id=server_id,
lease=Lease.objects.get(name=settings.DEFAULT_LEASE_NAME)
)
lease.clean()
lease.save()
return lease
......@@ -46,6 +46,8 @@ from common.models import (
)
from common.operations import Operation, register_operation
# from manager.scheduler import SchedulerError
from vm.models.vm_lease import VmLease
from .tasks.local_tasks import (
abortable_async_instance_operation, abortable_async_node_operation,
)
......@@ -645,52 +647,44 @@ class RenewOperation(InstanceOperation):
"expire. This operation renews expiration times according "
"to the lease type. If the machine is close to the "
"expiration, its owner will be notified.")
acl_level = "operator"
required_perms = ()
concurrency_check = False
def set_time_of_suspend(self, activity, suspend, force):
with activity.sub_activity(
'renew_suspend', concurrency_check=False,
readable_name=ugettext_noop('set time of suspend')):
if (not force and suspend and self.instance.time_of_suspend and
suspend < self.instance.time_of_suspend):
def set_time_of_suspend(self, vm_lease, suspend, force):
if (not force and suspend and vm_lease.time_of_suspend and
suspend < vm_lease.time_of_suspend):
raise HumanReadableException.create(ugettext_noop(
"Renewing the machine with the selected lease would "
"result in its suspension time get earlier than before."))
self.instance.time_of_suspend = suspend
vm_lease.time_of_suspend = suspend
def set_time_of_delete(self, activity, delete, force):
with activity.sub_activity(
'renew_delete', concurrency_check=False,
readable_name=ugettext_noop('set time of delete')):
if (not force and delete and self.instance.time_of_delete and
delete < self.instance.time_of_delete):
def set_time_of_delete(self, vm_lease, delete, force):
if (not force and delete and vm_lease.time_of_delete and
delete < vm_lease.time_of_delete):
raise HumanReadableException.create(ugettext_noop(
"Renewing the machine with the selected lease would "
"result in its delete time get earlier than before."))
self.instance.time_of_delete = delete
vm_lease.time_of_delete = delete
def _operation(self, activity, lease=None, force=False, save=False):
suspend, delete = self.instance.get_renew_times(lease)
def _operation(self, request, lease=None, force=False, save=False):
vm_lease = VmLease.get_or_create_lease(self.instance.id)
suspend, delete = vm_lease.get_renew_times(lease)
try:
self.set_time_of_suspend(activity, suspend, force)
self.set_time_of_suspend(vm_lease, suspend, force)
except HumanReadableException:
pass
try:
self.set_time_of_delete(activity, delete, force)
self.set_time_of_delete(vm_lease, delete, force)
except HumanReadableException:
pass
if save:
self.instance.lease = lease
vm_lease.lease = lease
self.instance.save()
vm_lease.save()
return create_readable(ugettext_noop(
"Renewed to suspend at %(suspend)s and destroy at %(delete)s."),
suspend=self.instance.time_of_suspend,
delete=self.instance.time_of_suspend)
suspend=vm_lease.time_of_suspend,
delete=vm_lease.time_of_suspend)
@register_operation
......
from django.conf import settings
from django.apps import AppConfig
class DefaultLeaseConfig(AppConfig):
name = 'vm'
def ready(self):
from vm.models import Lease
try:
Lease.objects.get(name=settings.DEFAULT_LEASE_NAME)
except Lease.DoesNotExist:
Lease(
name=settings.DEFAULT_LEASE_NAME,
suspend_interval_seconds=settings.DEFAULT_LEASE_SUSPEND_SECONDS,
delete_interval_seconds=settings.DEFAULT_LEASE_DELETE_SECONDS,
).save()
from test import *
\ No newline at end of file
from lease_tasks import *
\ No newline at end of file
from celery.decorators import periodic_task
from celery.task.schedules import crontab
from django.conf import settings
from openstack_auth.utils import fix_auth_url_version
from keystoneauth1.identity import v3
from keystoneauth1 import session
from vm.models import Lease
from vm.models.vm_lease import VmLease
def get_projects():
from keystoneclient.v3 import client
auth = v3.Password(
auth_url=fix_auth_url_version(settings.OPENSTACK_KEYSTONE_URL),
user_id=settings.OPENSTACK_CIRCLE_USERID,
password=settings.OPENSTACK_CIRCLE_PASSWORD,
)
sess = session.Session(auth=auth, verify=False)
keystone = client.Client(session=sess, interface=settings.OPENSTACK_INTERFACE)
return keystone.projects.list(
domain=settings.OPENSTACK_CIRCLE_DOMAIN_ID,
user=settings.OPENSTACK_CIRCLE_USERID
)
def get_project_client(project):
from novaclient import client
auth = v3.Password(
auth_url=fix_auth_url_version(settings.OPENSTACK_KEYSTONE_URL),
user_id=settings.OPENSTACK_CIRCLE_USERID,
password=settings.OPENSTACK_CIRCLE_PASSWORD,
project_id=project.id,
)
sess = session.Session(auth=auth, verify=False)
return client.Client("2.0", session=sess)
@periodic_task(run_every=crontab(hour="*", minute="*", day_of_week="*"))
def check_lease_expiration():
projects = get_projects()
for project in projects:
client = get_project_client(project)
servers = client.servers.list()
for server in servers:
lease = VmLease.get_or_create_lease(server.id)
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