Commit a1d135bf by Szabolcs Gelencser

Deploy and Shutoff operations work

parent 7cb09284
...@@ -2,98 +2,13 @@ ...@@ -2,98 +2,13 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="1fbec8af-5a7c-40f9-b994-83ac07d1ae1d" name="Default" comment=""> <list default="true" id="1fbec8af-5a7c-40f9-b994-83ac07d1ae1d" name="Default" comment="">
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/__init__.py" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/base.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/cinder.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/glance.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/keystone.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/microversions.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/network.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/neutron.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/nova.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/rest/__init__.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/rest/cinder.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/rest/config.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/rest/glance.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/rest/json_encoder.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/rest/keystone.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/rest/network.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/rest/neutron.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/rest/nova.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/rest/policy.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/rest/swift.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/rest/urls.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/rest/utils.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_api/swift.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/__init__.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/backend.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/exceptions.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/forms.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/locale/de/LC_MESSAGES/django.po" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/locale/en_GB/LC_MESSAGES/django.po" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/locale/eo/LC_MESSAGES/django.po" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/locale/es/LC_MESSAGES/django.po" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/locale/fr/LC_MESSAGES/django.po" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/locale/id/LC_MESSAGES/django.po" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/locale/ja/LC_MESSAGES/django.po" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/locale/ko_KR/LC_MESSAGES/django.po" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/locale/pt_BR/LC_MESSAGES/django.po" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/locale/zh_CN/LC_MESSAGES/django.po" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/models.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/plugin/__init__.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/plugin/base.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/plugin/k2k.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/plugin/password.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/plugin/token.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/policy.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/tests/__init__.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/tests/conf/keystone_policy.json" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/tests/conf/no_default_policy.json" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/tests/conf/nova_policy.json" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/tests/conf/policy.v3cloudsample.json" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/tests/conf/with_default_policy.json" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/tests/data_v2.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/tests/data_v3.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/tests/settings.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/tests/templates/auth/blank.html" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/tests/templates/auth/login.html" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/tests/unit/__init__.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/tests/unit/test_auth.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/tests/unit/test_policy.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/tests/unit/test_user.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/tests/unit/test_utils.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/tests/urls.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/urls.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/user.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/utils.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/openstack_auth/views.py" />
<change beforePath="$PROJECT_DIR$/circle/acl/models.py" afterPath="$PROJECT_DIR$/circle/acl/models.py" /> <change beforePath="$PROJECT_DIR$/circle/acl/models.py" afterPath="$PROJECT_DIR$/circle/acl/models.py" />
<change beforePath="$PROJECT_DIR$/circle/circle/settings/base.py" afterPath="$PROJECT_DIR$/circle/circle/settings/base.py" /> <change beforePath="$PROJECT_DIR$/circle/circle/db.sqlite3" afterPath="$PROJECT_DIR$/circle/circle/db.sqlite3" />
<change beforePath="$PROJECT_DIR$/circle/circle/settings/local.py" afterPath="$PROJECT_DIR$/circle/circle/settings/local.py" /> <change beforePath="$PROJECT_DIR$/circle/common/operations.py" afterPath="$PROJECT_DIR$/circle/common/operations.py" />
<change beforePath="$PROJECT_DIR$/circle/circle/urls.py" afterPath="$PROJECT_DIR$/circle/circle/urls.py" />
<change beforePath="$PROJECT_DIR$/circle/common/models.py" afterPath="$PROJECT_DIR$/circle/common/models.py" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/admin.py" afterPath="$PROJECT_DIR$/circle/dashboard/admin.py" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/context_processors.py" afterPath="$PROJECT_DIR$/circle/dashboard/context_processors.py" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/forms.py" afterPath="$PROJECT_DIR$/circle/dashboard/forms.py" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/models.py" afterPath="$PROJECT_DIR$/circle/dashboard/models.py" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/tables.py" afterPath="$PROJECT_DIR$/circle/dashboard/tables.py" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/templates/base.html" afterPath="$PROJECT_DIR$/circle/dashboard/templates/base.html" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/base.html" afterPath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/base.html" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/index-vm.html" afterPath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/index-vm.html" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/index.html" afterPath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/index.html" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail.html" afterPath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail.html" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/access.html" afterPath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/access.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/urls.py" afterPath="$PROJECT_DIR$/circle/dashboard/urls.py" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/views/__init__.py" afterPath="$PROJECT_DIR$/circle/dashboard/views/__init__.py" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/views/index.py" afterPath="$PROJECT_DIR$/circle/dashboard/views/index.py" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/views/user.py" afterPath="$PROJECT_DIR$/circle/dashboard/views/user.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/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/dashboard/views/vm.py" afterPath="$PROJECT_DIR$/circle/dashboard/views/vm.py" />
<change beforePath="$PROJECT_DIR$/circle/firewall/models.py" afterPath="$PROJECT_DIR$/circle/firewall/models.py" />
<change beforePath="$PROJECT_DIR$/circle/request/models.py" afterPath="$PROJECT_DIR$/circle/request/models.py" />
<change beforePath="$PROJECT_DIR$/circle/storage/models.py" afterPath="$PROJECT_DIR$/circle/storage/models.py" />
<change beforePath="$PROJECT_DIR$/circle/vm/models/__init__.py" afterPath="$PROJECT_DIR$/circle/vm/models/__init__.py" />
<change beforePath="$PROJECT_DIR$/circle/vm/models/instance.py" afterPath="$PROJECT_DIR$/circle/vm/models/instance.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/operations.py" afterPath="$PROJECT_DIR$/circle/vm/operations.py" />
</list> </list>
...@@ -124,88 +39,42 @@ ...@@ -124,88 +39,42 @@
<file leaf-file-name="urls.py" pinned="false" current-in-tab="false"> <file leaf-file-name="urls.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/dashboard/urls.py"> <entry file="file://$PROJECT_DIR$/circle/dashboard/urls.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3706"> <state relative-caret-position="163">
<caret line="226" column="18" lean-forward="false" selection-start-line="226" selection-start-column="18" selection-end-line="226" selection-end-column="18" /> <caret line="101" column="35" lean-forward="true" selection-start-line="101" selection-start-column="35" selection-end-line="101" selection-end-column="35" />
<folding /> <folding>
</state> <element signature="e#732#770#0" expanded="true" />
</provider> </folding>
</entry>
</file>
<file leaf-file-name="util.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/util.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="629">
<caret line="105" column="79" lean-forward="true" selection-start-line="105" selection-start-column="79" selection-end-line="105" selection-end-column="79" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="models.py" pinned="false" current-in-tab="false"> <file leaf-file-name="__init__.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/acl/models.py"> <entry file="file://$PROJECT_DIR$/circle/dashboard/views/__init__.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2601"> <state relative-caret-position="187">
<caret line="164" column="19" lean-forward="false" selection-start-line="164" selection-start-column="19" selection-end-line="164" selection-end-column="19" /> <caret line="11" column="5" lean-forward="false" selection-start-line="11" selection-start-column="5" selection-end-line="11" selection-end-column="5" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="vm.py" pinned="false" current-in-tab="false"> <file leaf-file-name="vm.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/vm.py"> <entry file="file://$PROJECT_DIR$/circle/dashboard/views/vm.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="4488"> <state relative-caret-position="350">
<caret line="307" column="14" lean-forward="false" selection-start-line="307" selection-start-column="14" selection-end-line="307" selection-end-column="14" /> <caret line="1308" column="56" lean-forward="false" selection-start-line="1308" selection-start-column="56" selection-end-line="1308" selection-end-column="56" />
<folding /> <folding>
</state> <element signature="e#731#787#0" expanded="true" />
</provider> </folding>
</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="2057">
<caret line="162" column="0" lean-forward="false" selection-start-line="162" selection-start-column="0" selection-end-line="162" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="activity.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/vm/models/activity.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1598">
<caret line="111" column="0" lean-forward="false" selection-start-line="111" selection-start-column="0" selection-end-line="111" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="operations.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/common/operations.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2261">
<caret line="140" column="0" lean-forward="false" selection-start-line="140" selection-start-column="0" selection-end-line="140" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="base.py" pinned="false" current-in-tab="false">
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/template/base.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="16898">
<caret line="1023" column="0" lean-forward="false" selection-start-line="1023" selection-start-column="0" selection-end-line="1023" selection-end-column="0" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="wsgi.py" pinned="false" current-in-tab="false"> <file leaf-file-name="models.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/circle/wsgi.py"> <entry file="file://$PROJECT_DIR$/circle/dashboard/models.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="969"> <state relative-caret-position="205">
<caret line="59" column="0" lean-forward="false" selection-start-line="59" selection-start-column="0" selection-end-line="59" selection-end-column="0" /> <caret line="86" column="27" lean-forward="false" selection-start-line="86" selection-start-column="27" selection-end-line="86" selection-end-column="27" />
<folding /> <folding />
</state> </state>
</provider> </provider>
...@@ -214,8 +83,8 @@ ...@@ -214,8 +83,8 @@
<file leaf-file-name="instance.py" pinned="false" current-in-tab="false"> <file leaf-file-name="instance.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/vm/models/instance.py"> <entry file="file://$PROJECT_DIR$/circle/vm/models/instance.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="4624"> <state relative-caret-position="197">
<caret line="310" column="0" lean-forward="false" selection-start-line="310" selection-start-column="0" selection-end-line="310" selection-end-column="0" /> <caret line="334" column="0" lean-forward="true" selection-start-line="334" selection-start-column="0" selection-end-line="334" selection-end-column="0" />
<folding /> <folding />
</state> </state>
</provider> </provider>
...@@ -233,29 +102,6 @@ ...@@ -233,29 +102,6 @@
</component> </component>
<component name="FindInProjectRecents"> <component name="FindInProjectRecents">
<findStrings> <findStrings>
<find>orderedDict</find>
<find>VmDeploy</find>
<find>VmOpera</find>
<find>class VmOpera</find>
<find>OperationView</find>
<find>TokenOperationView</find>
<find>refrest</find>
<find>get_fr</find>
<find>access_method</find>
<find>_format_ac</find>
<find>acti</find>
<find>get_acti</find>
<find>vm_acti</find>
<find>render_to_string</find>
<find>autocom</find>
<find>stat</find>
<find>get_status_</find>
<find>get_status</find>
<find>get_status_displa</find>
<find>get_status_display</find>
<find>STATUS</find>
<find>icon</find>
<find>os</find>
<find>system</find> <find>system</find>
<find>@profiler.trace</find> <find>@profiler.trace</find>
<find>access</find> <find>access</find>
...@@ -263,7 +109,33 @@ ...@@ -263,7 +109,33 @@
<find>dep</find> <find>dep</find>
<find>precond</find> <find>precond</find>
<find>deployopera</find> <find>deployopera</find>
<find>Subope</find>
<find>suboper</find>
<find>deployoper</find>
<find>with_reload</find>
<find>deploy</find>
<find>vmdetail</find>
<find>TokenOperationView</find>
<find>deployope</find>
<find>deployOpe</find>
<find>vm_ops</find>
<find>w</find>
<find>wakeup</find>
<find>sleep</find>
<find>RUNNING</find>
<find>'RUNNING'</find>
<find>Deploy</find>
<find>DeployOpe</find>
<find>rebootoper</find>
<find>shutoff</find>
<find>operationview</find>
<find>fav</find>
<find>favou</find>
<find>favouritevi</find>
</findStrings> </findStrings>
<replaceStrings>
<replace>'ACTIVE'</replace>
</replaceStrings>
</component> </component>
<component name="Git.Settings"> <component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
...@@ -308,12 +180,13 @@ ...@@ -308,12 +180,13 @@
<option value="$PROJECT_DIR$/circle/openstack_api/nova.py" /> <option value="$PROJECT_DIR$/circle/openstack_api/nova.py" />
<option value="$PROJECT_DIR$/circle/openstack_api/glance.py" /> <option value="$PROJECT_DIR$/circle/openstack_api/glance.py" />
<option value="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail.html" /> <option value="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail.html" />
<option value="$PROJECT_DIR$/circle/dashboard/urls.py" />
<option value="$PROJECT_DIR$/circle/vm/models/instance.py" />
<option value="$PROJECT_DIR$/circle/dashboard/views/util.py" />
<option value="$PROJECT_DIR$/circle/acl/models.py" /> <option value="$PROJECT_DIR$/circle/acl/models.py" />
<option value="$PROJECT_DIR$/circle/dashboard/views/vm.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/operations.py" /> <option value="$PROJECT_DIR$/circle/vm/operations.py" />
<option value="$PROJECT_DIR$/circle/common/operations.py" />
<option value="$PROJECT_DIR$/circle/dashboard/views/vm.py" />
<option value="$PROJECT_DIR$/circle/dashboard/urls.py" />
</list> </list>
</option> </option>
</component> </component>
...@@ -324,9 +197,9 @@ ...@@ -324,9 +197,9 @@
<sorting>DEFINITION_ORDER</sorting> <sorting>DEFINITION_ORDER</sorting>
</component> </component>
<component name="ProjectFrameBounds"> <component name="ProjectFrameBounds">
<option name="x" value="1918" /> <option name="x" value="-2" />
<option name="y" value="-1" /> <option name="y" value="-1" />
<option name="width" value="962" /> <option name="width" value="1924" />
<option name="height" value="1063" /> <option name="height" value="1063" />
</component> </component>
<component name="ProjectInspectionProfilesVisibleTreeState"> <component name="ProjectInspectionProfilesVisibleTreeState">
...@@ -366,6 +239,7 @@ ...@@ -366,6 +239,7 @@
<foldersAlwaysOnTop value="true" /> <foldersAlwaysOnTop value="true" />
</navigator> </navigator>
<panes> <panes>
<pane id="Scope" />
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
<expand> <expand>
...@@ -388,23 +262,19 @@ ...@@ -388,23 +262,19 @@
<item name="cloud" type="b2602c69:ProjectViewProjectNode" /> <item name="cloud" type="b2602c69:ProjectViewProjectNode" />
<item name="cloud" type="462c0819:PsiDirectoryNode" /> <item name="cloud" type="462c0819:PsiDirectoryNode" />
<item name="circle" type="462c0819:PsiDirectoryNode" /> <item name="circle" type="462c0819:PsiDirectoryNode" />
<item name="openstack_auth" type="462c0819:PsiDirectoryNode" /> <item name="acl" type="462c0819:PsiDirectoryNode" />
<item name="management" type="462c0819:PsiDirectoryNode" />
</path> </path>
<path> <path>
<item name="cloud" type="b2602c69:ProjectViewProjectNode" /> <item name="cloud" type="b2602c69:ProjectViewProjectNode" />
<item name="cloud" type="462c0819:PsiDirectoryNode" /> <item name="cloud" type="462c0819:PsiDirectoryNode" />
<item name="circle" type="462c0819:PsiDirectoryNode" /> <item name="circle" type="462c0819:PsiDirectoryNode" />
<item name="vm" type="462c0819:PsiDirectoryNode" /> <item name="dashboard" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="cloud" type="b2602c69:ProjectViewProjectNode" />
<item name="External Libraries" type="cb654da1:ExternalLibrariesNode" />
</path> </path>
</expand> </expand>
<select /> <select />
</subPane> </subPane>
</pane> </pane>
<pane id="Scope" />
<pane id="Scratches" /> <pane id="Scratches" />
</panes> </panes>
</component> </component>
...@@ -414,7 +284,7 @@ ...@@ -414,7 +284,7 @@
<property name="settings.editor.selected.configurable" value="preferences.keymap" /> <property name="settings.editor.selected.configurable" value="preferences.keymap" />
<property name="NewWatcherDialog.advanced.open" value="true" /> <property name="NewWatcherDialog.advanced.open" value="true" />
<property name="DefaultHtmlFileTemplate" value="HTML File" /> <property name="DefaultHtmlFileTemplate" value="HTML File" />
<property name="SearchEverywhereHistoryKey" value="Deploy&#9;null&#9;null&#10;Instance&#9;null&#9;null&#10;Vmdeta&#9;null&#9;null&#10;list_from&#9;null&#9;null&#10;aclupda&#9;null&#9;null&#10;base.htm&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/base.html&#10;method&#9;ACTION&#9;GoToMenuEx&#10;index.html&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index.html&#10;base.ht&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/base.html&#10;base.html&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/base.html&#10;index.py&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/views/index.py&#10;index.htm&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index.html&#10;server&#9;null&#9;null&#10;Disk&#9;null&#9;null" /> <property name="SearchEverywhereHistoryKey" value="sleep&#9;null&#9;null&#10;Deploy&#9;null&#9;null&#10;Instance&#9;null&#9;null&#10;Vmdeta&#9;null&#9;null&#10;list_from&#9;null&#9;null&#10;aclupda&#9;null&#9;null&#10;base.htm&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/base.html&#10;method&#9;ACTION&#9;GoToMenuEx&#10;index.html&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index.html&#10;base.ht&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/base.html&#10;base.html&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/base.html&#10;index.py&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/views/index.py&#10;index.htm&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index.html&#10;server&#9;null&#9;null&#10;Disk&#9;null&#9;null" />
</component> </component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS"> <key name="MoveFile.RECENT_KEYS">
...@@ -475,28 +345,28 @@ ...@@ -475,28 +345,28 @@
<servers /> <servers />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="1918" y="-1" width="962" height="1063" extended-state="0" /> <frame x="-2" y="-1" width="1924" height="1063" extended-state="0" />
<editor active="true" /> <editor active="true" />
<layout> <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.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.327818" sideWeight="0.5021299" 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.327818" sideWeight="0.5021299" order="7" 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.32875264" sideWeight="0.4978701" order="2" 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.32875264" sideWeight="0.5" order="7" 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.32875264" sideWeight="0.5" 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.39852008" sideWeight="0.42438763" order="7" side_tool="true" 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.39852008" sideWeight="0.42438763" order="7" 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.32875264" sideWeight="0.4978701" 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.3689218" sideWeight="0.4339723" order="7" 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.397463" sideWeight="0.4318424" 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.157082" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.3187773" 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="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="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.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="3" 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="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="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="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.43023255" sideWeight="0.5660277" order="3" 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="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.3689218" sideWeight="0.5681576" 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="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="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="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="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" /> <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="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="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="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="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="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>
<layout-to-restore> <layout-to-restore>
...@@ -536,11 +406,6 @@ ...@@ -536,11 +406,6 @@
<line>82</line> <line>82</line>
<option name="timeStamp" value="13" /> <option name="timeStamp" value="13" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/circle/vm/operations.py</url>
<line>157</line>
<option name="timeStamp" value="81" />
</line-breakpoint>
</breakpoints> </breakpoints>
<breakpoints-dialog> <breakpoints-dialog>
<breakpoints-dialog /> <breakpoints-dialog />
...@@ -552,13 +417,18 @@ ...@@ -552,13 +417,18 @@
</properties> </properties>
</breakpoint> </breakpoint>
</default-breakpoints> </default-breakpoints>
<option name="time" value="82" /> <option name="time" value="104" />
</breakpoint-manager> </breakpoint-manager>
<watches-manager /> <watches-manager />
</component> </component>
<component name="debuggerHistoryManager"> <component name="debuggerHistoryManager">
<expressions id="evaluateExpression"> <expressions id="evaluateExpression">
<expression> <expression>
<expression-string>json.dumps(response)</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>self</expression-string> <expression-string>self</expression-string>
<language-id>Python</language-id> <language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode> <evaluation-mode>EXPRESSION</evaluation-mode>
...@@ -598,58 +468,9 @@ ...@@ -598,58 +468,9 @@
<language-id>Python</language-id> <language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode> <evaluation-mode>EXPRESSION</evaluation-mode>
</expression> </expression>
<expression>
<expression-string>activities = openstack_api.nova.instance_action_list(self.request, instance.os_server_id)</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
</expressions> </expressions>
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file:///usr/lib/python2.7/importlib/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="408">
<caret line="36" column="0" lean-forward="false" selection-start-line="36" selection-start-column="0" selection-end-line="36" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/group.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="173">
<caret line="36" column="0" lean-forward="false" selection-start-line="36" selection-start-column="0" selection-end-line="36" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/base.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-7">
<caret line="79" column="58" lean-forward="true" selection-start-line="79" selection-start-column="58" selection-end-line="79" selection-end-column="58" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/forms/models.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="275">
<caret line="276" column="0" lean-forward="false" selection-start-line="276" selection-start-column="0" selection-end-line="276" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/db/models/base.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="299">
<caret line="1258" column="0" lean-forward="true" selection-start-line="1258" selection-start-column="0" selection-end-line="1258" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/db/models/manager.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="306">
<caret line="174" column="20" lean-forward="false" selection-start-line="174" selection-start-column="20" selection-end-line="174" selection-end-column="20" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/vm/managers/os_instance_manager.py" />
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/braces/views/_access.py"> <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"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="419"> <state relative-caret-position="419">
...@@ -694,13 +515,6 @@ ...@@ -694,13 +515,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="187">
<caret line="11" column="0" lean-forward="true" selection-start-line="11" selection-start-column="0" selection-end-line="11" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/openstack_auth/plugin/base.py"> <entry file="file://$PROJECT_DIR$/circle/openstack_auth/plugin/base.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="317"> <state relative-caret-position="317">
...@@ -708,13 +522,6 @@ ...@@ -708,13 +522,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/index.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="181">
<caret line="40" column="42" lean-forward="false" selection-start-line="40" selection-start-column="42" selection-end-line="40" selection-end-column="42" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/index-vm.html"> <entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/index-vm.html">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="595"> <state relative-caret-position="595">
...@@ -764,13 +571,6 @@ ...@@ -764,13 +571,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/circle/openstack_api/nova.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="181">
<caret line="1043" column="4" lean-forward="false" selection-start-line="1043" selection-start-column="4" selection-end-line="1043" selection-end-column="4" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/_activity-timeline.html"> <entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/_activity-timeline.html">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-357"> <state relative-caret-position="-357">
...@@ -799,13 +599,6 @@ ...@@ -799,13 +599,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/core/handlers/exception.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="181">
<caret line="40" column="0" lean-forward="false" selection-start-line="40" selection-start-column="0" selection-end-line="40" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file:///usr/lib/python2.7/threading.py"> <entry file="file:///usr/lib/python2.7/threading.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="181"> <state relative-caret-position="181">
...@@ -848,13 +641,6 @@ ...@@ -848,13 +641,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/core/handlers/base.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="173">
<caret line="123" column="0" lean-forward="false" selection-start-line="123" selection-start-column="0" selection-end-line="123" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/views/generic/base.py"> <entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/views/generic/base.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="275"> <state relative-caret-position="275">
...@@ -863,14 +649,6 @@ ...@@ -863,14 +649,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3706">
<caret line="226" column="18" lean-forward="false" selection-start-line="226" selection-start-column="18" selection-end-line="226" selection-end-column="18" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/views/generic/detail.py"> <entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/views/generic/detail.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="198"> <state relative-caret-position="198">
...@@ -879,14 +657,6 @@ ...@@ -879,14 +657,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/circle/acl/models.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2601">
<caret line="164" column="19" lean-forward="false" selection-start-line="164" selection-start-column="19" selection-end-line="164" selection-end-column="19" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/operate.html"> <entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/operate.html">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
...@@ -894,14 +664,6 @@ ...@@ -894,14 +664,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/vm.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="4488">
<caret line="307" column="14" lean-forward="false" selection-start-line="307" selection-start-column="14" selection-end-line="307" selection-end-column="14" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/contrib/auth/models.py"> <entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/contrib/auth/models.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="190"> <state relative-caret-position="190">
...@@ -933,45 +695,171 @@ ...@@ -933,45 +695,171 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/circle/vm/models/instance.py"> <entry file="file://$PROJECT_DIR$/circle/vm/models/activity.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="4624"> <state relative-caret-position="1598">
<caret line="310" column="0" lean-forward="false" selection-start-line="310" selection-start-column="0" selection-end-line="310" selection-end-column="0" /> <caret line="111" column="0" lean-forward="false" selection-start-line="111" selection-start-column="0" selection-end-line="111" selection-end-column="0" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/circle/vm/models/activity.py"> <entry file="file://$PROJECT_DIR$/circle/acl/models.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1598"> <state relative-caret-position="420">
<caret line="111" column="0" lean-forward="false" selection-start-line="111" selection-start-column="0" selection-end-line="111" selection-end-column="0" /> <caret line="150" column="55" lean-forward="true" selection-start-line="150" selection-start-column="55" selection-end-line="150" selection-end-column="55" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/circle/vm/operations.py"> <entry file="file://$PROJECT_DIR$/circle/vm/tasks/local_tasks.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="326">
<caret line="33" column="30" lean-forward="true" selection-start-line="33" selection-start-column="30" selection-end-line="33" selection-end-column="30" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.PyCharm2017.3/system/python_stubs/-66389823/__builtin__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="190">
<caret line="518" column="4" lean-forward="false" selection-start-line="518" selection-start-column="4" selection-end-line="518" selection-end-column="4" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/views/decorators/http.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="527">
<caret line="39" column="0" lean-forward="false" selection-start-line="39" selection-start-column="0" selection-end-line="39" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/core/handlers/base.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="411">
<caret line="248" column="0" lean-forward="false" selection-start-line="248" selection-start-column="0" selection-end-line="248" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/openstack_api/nova.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="190">
<caret line="544" column="4" lean-forward="false" selection-start-line="544" selection-start-column="4" selection-end-line="544" selection-end-column="4" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/utils/functional.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="199">
<caret line="66" column="0" lean-forward="false" selection-start-line="66" selection-start-column="0" selection-end-line="66" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/index.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="190">
<caret line="40" column="0" lean-forward="false" selection-start-line="40" selection-start-column="0" selection-end-line="40" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/utils/autoreload.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2057"> <state relative-caret-position="171">
<caret line="162" column="0" lean-forward="false" selection-start-line="162" selection-start-column="0" selection-end-line="162" selection-end-column="0" /> <caret line="227" column="0" lean-forward="false" selection-start-line="227" selection-start-column="0" selection-end-line="227" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$APPLICATION_HOME_DIR$/helpers/pydev/_pydev_bundle/pydev_monkey.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="163">
<caret line="588" column="0" lean-forward="false" selection-start-line="588" selection-start-column="0" selection-end-line="588" selection-end-column="0" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/circle/common/operations.py"> <entry file="file://$PROJECT_DIR$/circle/common/operations.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2261"> <state relative-caret-position="214">
<caret line="140" column="0" lean-forward="false" selection-start-line="140" selection-start-column="0" selection-end-line="140" selection-end-column="0" /> <caret line="50" column="11" lean-forward="false" selection-start-line="50" selection-start-column="11" selection-end-line="50" selection-end-column="11" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/core/handlers/exception.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="494">
<caret line="59" column="37" lean-forward="false" selection-start-line="59" selection-start-column="37" selection-end-line="59" selection-end-column="37" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/vm/operations.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="163">
<caret line="144" column="0" lean-forward="false" selection-start-line="144" selection-start-column="0" selection-end-line="144" selection-end-column="0" />
<folding>
<element signature="e#732#788#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/util.py"> <entry file="file://$PROJECT_DIR$/circle/dashboard/views/util.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="629"> <state relative-caret-position="265">
<caret line="105" column="79" lean-forward="true" selection-start-line="105" selection-start-column="79" selection-end-line="105" selection-end-column="79" /> <caret line="302" column="22" lean-forward="false" selection-start-line="302" selection-start-column="22" selection-end-line="302" selection-end-column="22" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/vm/models/instance.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="197">
<caret line="334" column="0" lean-forward="true" selection-start-line="334" selection-start-column="0" selection-end-line="334" selection-end-column="0" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="187">
<caret line="11" column="5" lean-forward="false" selection-start-line="11" selection-start-column="5" selection-end-line="11" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/models.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="205">
<caret line="86" column="27" lean-forward="false" selection-start-line="86" selection-start-column="27" selection-end-line="86" selection-end-column="27" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="163">
<caret line="101" column="35" lean-forward="true" selection-start-line="101" selection-start-column="35" selection-end-line="101" selection-end-column="35" />
<folding>
<element signature="e#732#770#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/vm.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="350">
<caret line="1308" column="56" lean-forward="false" selection-start-line="1308" selection-start-column="56" selection-end-line="1308" selection-end-column="56" />
<folding>
<element signature="e#731#787#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component> </component>
</project> </project>
\ No newline at end of file
...@@ -76,20 +76,10 @@ class AclBase(Model): ...@@ -76,20 +76,10 @@ class AclBase(Model):
object_level_set = GenericRelation(ObjectLevel) object_level_set = GenericRelation(ObjectLevel)
def clone_acl(self, other): def clone_acl(self, other):
"""Clone full ACL from other object.""" pass
assert self.id != other.id or type(self) != type(other)
self.object_level_set.clear()
for i in other.object_level_set.all():
ol = self.object_level_set.create(level=i.level)
for j in i.users.all():
ol.users.add(j)
for j in i.groups.all():
ol.groups.add(j)
@classmethod @classmethod
def get_level_object(cls, level): def get_level_object(cls, level):
"""Get Level object for this model by codename."""
ct = ContentType.objects.get_for_model(cls) ct = ContentType.objects.get_for_model(cls)
return Level.objects.get(codename=level, content_type=ct) return Level.objects.get(codename=level, content_type=ct)
...@@ -110,104 +100,28 @@ class AclBase(Model): ...@@ -110,104 +100,28 @@ class AclBase(Model):
raise AttributeError('"whom" must be a User or Group object.') raise AttributeError('"whom" must be a User or Group object.')
def set_user_level(self, user, level): def set_user_level(self, user, level):
#TODO: delete
"""Set level of object for a user. pass
:param whom: user the level is set for
:type whom: User
:param level: codename of level to set, or None
:type level: Level or str or unicode or NoneType
"""
logger.info('%s.set_user_level(%s, %s) called',
*[unicode(p) for p in [self, user, level]])
if level is None:
pk = None
else:
if isinstance(level, basestring):
level = self.get_level_object(level)
if not self.object_level_set.filter(level_id=level.pk).exists():
self.object_level_set.create(level=level)
pk = level.pk
for i in self.object_level_set.all():
if i.level_id != pk:
i.users.remove(user)
else:
i.users.add(user)
i.save()
def set_group_level(self, group, level): def set_group_level(self, group, level):
#TODO: delete
"""Set level of object for a user. pass
:param whom: user the level is set for
:type whom: User or unicode or str
:param level: codename of level to set
:type level: str or unicode
"""
logger.info('%s.set_group_level(%s, %s) called',
*[unicode(p) for p in [self, group, level]])
if level is None:
pk = None
else:
if isinstance(level, basestring):
level = self.get_level_object(level)
if not self.object_level_set.filter(level_id=level.pk).exists():
self.object_level_set.create(level=level)
pk = level.pk
for i in self.object_level_set.all():
if i.level_id != pk:
i.groups.remove(group)
else:
i.groups.add(group)
i.save()
def has_level(self, user, level, group_also=True): def has_level(self, user, level, group_also=True):
return True #TODO: implement
logger.debug('%s.has_level(%s, %s, %s) called', logger.debug('%s.has_level(%s, %s, %s) called',
*[unicode(p) for p in [self, user, level, group_also]]) *[unicode(p) for p in [self, user, level, group_also]])
if user is None or not user.is_authenticated(): return True
return False
if getattr(user, 'is_superuser', False):
logger.debug('- superuser granted')
return True
if isinstance(level, basestring):
level = self.get_level_object(level)
logger.debug("- level set by str: %s", unicode(level))
object_levels = self.object_level_set.filter(
level__weight__gte=level.weight).all()
groups = user.groups.values_list('id', flat=True) if group_also else []
for i in object_levels:
if i.users.filter(pk=user.pk).exists():
return True
if group_also and i.groups.filter(pk__in=groups).exists():
return True
return False
def get_users_with_level(self, **kwargs): def get_users_with_level(self, **kwargs):
# TODO: implement
logger.debug('%s.get_users_with_level() called', unicode(self)) logger.debug('%s.get_users_with_level() called', unicode(self))
object_levels = (self.object_level_set.filter(**kwargs).select_related( return []
'level').prefetch_related('users').all())
users = []
for object_level in object_levels:
name = object_level.level.codename
olusers = object_level.users.all()
users.extend([(u, name) for u in olusers])
logger.debug('- %s: %s' % (name, [u.username for u in olusers]))
return users
def get_groups_with_level(self): def get_groups_with_level(self):
# TODO: implement
logger.debug('%s.get_groups_with_level() called', unicode(self)) logger.debug('%s.get_groups_with_level() called', unicode(self))
object_levels = (self.object_level_set.select_related( return []
'level').prefetch_related('groups').all())
groups = []
for object_level in object_levels:
name = object_level.level.codename
olgroups = object_level.groups.all()
groups.extend([(g, name) for g in olgroups])
logger.debug('- %s: %s' % (name, [g.name for g in olgroups]))
return groups
@classmethod @classmethod
def get_objects_with_level(cls, level, user, def get_objects_with_level(cls, level, user,
......
No preview for this file type
...@@ -26,32 +26,15 @@ from .models import (activity_context, has_suffix, humanize_exception, ...@@ -26,32 +26,15 @@ from .models import (activity_context, has_suffix, humanize_exception,
logger = getLogger(__name__) logger = getLogger(__name__)
class SubOperationMixin(object):
required_perms = ()
def create_activity(self, parent, user, kwargs):
if not parent:
raise TypeError("SubOperation can only be called with "
"parent_activity specified.")
return super(SubOperationMixin, self).create_activity(
parent, user, kwargs)
class Operation(object): class Operation(object):
"""Base class for VM operations. """Base class for VM operations.
""" """
async_queue = 'localhost.man'
required_perms = None required_perms = None
superuser_required = False superuser_required = False
do_not_call_in_templates = True do_not_call_in_templates = True
abortable = False abortable = False
has_percentage = False has_percentage = False
@classmethod
def get_activity_code_suffix(cls):
return cls.id
def __call__(self, **kwargs): def __call__(self, **kwargs):
return self.call(**kwargs) return self.call(**kwargs)
...@@ -63,10 +46,12 @@ class Operation(object): ...@@ -63,10 +46,12 @@ class Operation(object):
def __unicode__(self): def __unicode__(self):
return self.name return self.name
def __prelude(self, kwargs): def __prelude(self, request, kwargs):
"""This method contains the shared prelude of call and async. """This method contains the shared prelude of call and async.
""" """
defaults = {'parent_activity': None, 'system': False, 'user': None} self._operation.im_self.get_from_os(request)
defaults = {'system': False, 'user': None}
allargs = dict(defaults, **kwargs) # all arguments allargs = dict(defaults, **kwargs) # all arguments
auxargs = allargs.copy() # auxiliary (i.e. only for _operation) args auxargs = allargs.copy() # auxiliary (i.e. only for _operation) args
...@@ -75,11 +60,8 @@ class Operation(object): ...@@ -75,11 +60,8 @@ class Operation(object):
skip_auth_check = auxargs.pop('system') skip_auth_check = auxargs.pop('system')
user = auxargs.pop('user') user = auxargs.pop('user')
parent_activity = auxargs.pop('parent_activity') if user is None: # parent was a system call
if parent_activity and user is None and not skip_auth_check: skip_auth_check = True
user = allargs['user'] = parent_activity.user
if user is None: # parent was a system call
skip_auth_check = True
# check for unexpected keyword arguments # check for unexpected keyword arguments
argspec = getargspec(self._operation) argspec = getargspec(self._operation)
...@@ -93,12 +75,9 @@ class Operation(object): ...@@ -93,12 +75,9 @@ class Operation(object):
self.check_auth(user) self.check_auth(user)
self.check_precond() self.check_precond()
activity = self.create_activity( return allargs, auxargs
parent=parent_activity, user=user, kwargs=kwargs)
return activity, allargs, auxargs
def _exec_op(self, allargs, auxargs): def _exec_op(self, request, allargs, auxargs):
"""Execute the operation inside the specified activity's context. """Execute the operation inside the specified activity's context.
""" """
# compile arguments for _operation # compile arguments for _operation
...@@ -110,13 +89,7 @@ class Operation(object): ...@@ -110,13 +89,7 @@ class Operation(object):
if k in argspec.args} if k in argspec.args}
arguments.update(auxargs) arguments.update(auxargs)
with activity_context(allargs['activity'], on_abort=self.on_abort, return self._operation(request, **arguments)
on_commit=self.on_commit) as act:
retval = self._operation(**arguments)
if (act.result is None and isinstance(
retval, (basestring, int, HumanReadableObject))):
act.result = retval
return retval
def _operation(self, **kwargs): def _operation(self, **kwargs):
"""This method is the operation's particular implementation. """This method is the operation's particular implementation.
...@@ -125,25 +98,7 @@ class Operation(object): ...@@ -125,25 +98,7 @@ class Operation(object):
""" """
raise NotImplementedError raise NotImplementedError
def async(self, **kwargs): def call(self, request, **kwargs):
"""Execute the operation asynchronously.
Only a quick, preliminary check is ran before creating the associated
activity and queuing the job.
The returned value is the handle for the asynchronous job.
For more information, check the synchronous call's documentation.
"""
logger.info("%s called asynchronously on %s with the following "
"parameters: %r", self.__class__.__name__, self.subject,
kwargs)
activity, allargs, auxargs = self.__prelude(kwargs)
return self.async_operation.apply_async(
args=(self.id, self.subject.pk, activity.pk, allargs, auxargs, ),
queue=self.async_queue)
def call(self, **kwargs):
"""Execute the operation (synchronously). """Execute the operation (synchronously).
Anticipated keyword arguments: Anticipated keyword arguments:
...@@ -159,9 +114,8 @@ class Operation(object): ...@@ -159,9 +114,8 @@ class Operation(object):
logger.info("%s called (synchronously) on %s with the following " logger.info("%s called (synchronously) on %s with the following "
"parameters: %r", self.__class__.__name__, self.subject, "parameters: %r", self.__class__.__name__, self.subject,
kwargs) kwargs)
activity, allargs, auxargs = self.__prelude(kwargs) allargs, auxargs = self.__prelude(request, kwargs)
allargs['activity'] = activity return self._exec_op(request, allargs, auxargs)
return self._exec_op(allargs, auxargs)
def check_precond(self): def check_precond(self):
pass pass
...@@ -185,11 +139,8 @@ class Operation(object): ...@@ -185,11 +139,8 @@ class Operation(object):
def check_auth(self, user): def check_auth(self, user):
"""Check if user is permitted to run this operation on this instance """Check if user is permitted to run this operation on this instance
""" """
#TODO: implement
self.check_perms(user) pass
def create_activity(self, parent, user, kwargs):
raise NotImplementedError
def on_abort(self, activity, error): def on_abort(self, activity, error):
"""This method is called when the operation aborts (i.e. raises an """This method is called when the operation aborts (i.e. raises an
...@@ -197,18 +148,6 @@ class Operation(object): ...@@ -197,18 +148,6 @@ class Operation(object):
""" """
pass pass
def get_activity_name(self, kwargs):
try:
return self.activity_name
except AttributeError:
try:
return self.name._proxy____args[0] # ewww!
except AttributeError:
raise ImproperlyConfigured(
"Set Operation.activity_name to an ugettext_nooped "
"string or a create_readable call, or override "
"get_activity_name to create a name dynamically")
def on_commit(self, activity): def on_commit(self, activity):
"""This method is called when the operation executes successfully. """This method is called when the operation executes successfully.
""" """
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
from __future__ import absolute_import from __future__ import absolute_import
from dashboard.views.autocomplete import AclUserGroupAutocomplete, AclUserAutocomplete from dashboard.views.autocomplete import AclUserGroupAutocomplete, AclUserAutocomplete
from dashboard.views.vm import VmDetailView, VmList, VmCreate, vm_activity, vm_ops from dashboard.views.vm import VmDetailView, VmList, VmCreate, vm_activity, vm_ops, FavouriteView
from django.conf.urls import url from django.conf.urls import url
from .views import ( from .views import (
...@@ -99,8 +99,8 @@ urlpatterns = [ ...@@ -99,8 +99,8 @@ urlpatterns = [
# url(r'^node/activity/(?P<pk>\d+)/$', NodeActivityDetail.as_view(), # url(r'^node/activity/(?P<pk>\d+)/$', NodeActivityDetail.as_view(),
# name='dashboard.views.node-activity'), # name='dashboard.views.node-activity'),
# #
# url(r'^favourite/$', FavouriteView.as_view(), url(r'^favourite/$', FavouriteView.as_view(),
# name='dashboard.views.favourite'), name='dashboard.views.favourite'),
# url(r'^group/delete/(?P<pk>\d+)/$', GroupDelete.as_view(), # url(r'^group/delete/(?P<pk>\d+)/$', GroupDelete.as_view(),
# name="dashboard.views.delete-group"), # name="dashboard.views.delete-group"),
# url(r'^group/list/$', GroupList.as_view(), # url(r'^group/list/$', GroupList.as_view(),
......
...@@ -294,7 +294,7 @@ class OperationView(RedirectToLoginMixin, DetailView): ...@@ -294,7 +294,7 @@ class OperationView(RedirectToLoginMixin, DetailView):
result = None result = None
done = False done = False
try: try:
task = self.get_op().async(user=request.user, **extra) task = self.get_op().call(request, user=request.user, **extra)
except HumanReadableException as e: except HumanReadableException as e:
e.send_message(request) e.send_message(request)
logger.exception("Could not start operation") logger.exception("Could not start operation")
......
...@@ -21,6 +21,7 @@ import logging ...@@ -21,6 +21,7 @@ import logging
from collections import OrderedDict from collections import OrderedDict
import openstack_api import openstack_api
from dashboard.models import Favourite
from django.conf import settings from django.conf import settings
from django.contrib import messages from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import LoginRequiredMixin
...@@ -110,8 +111,6 @@ class VmDetailView(LoginRequiredMixin, GraphMixin, DetailView): ...@@ -110,8 +111,6 @@ class VmDetailView(LoginRequiredMixin, GraphMixin, DetailView):
context = super(VmDetailView, self).get_context_data(**kwargs) context = super(VmDetailView, self).get_context_data(**kwargs)
instance = context['instance'] instance = context['instance']
user = self.request.user user = self.request.user
is_operator = instance.has_level(user, "operator")
is_owner = instance.has_level(user, "owner")
ops = get_operations(instance, user) ops = get_operations(instance, user)
hide_tutorial = self.request.COOKIES.get( hide_tutorial = self.request.COOKIES.get(
"hide_tutorial_for_%s" % instance.pk) == "True" "hide_tutorial_for_%s" % instance.pk) == "True"
...@@ -155,9 +154,7 @@ class VmDetailView(LoginRequiredMixin, GraphMixin, DetailView): ...@@ -155,9 +154,7 @@ class VmDetailView(LoginRequiredMixin, GraphMixin, DetailView):
# context['ipv6_port'] = instance.get_connect_port(use_ipv6=True) # context['ipv6_port'] = instance.get_connect_port(use_ipv6=True)
# resources forms # resources forms
can_edit = ( can_edit = True
instance.has_level(user, "owner") and
self.request.user.has_perm("vm.change_resources"))
context['resources_form'] = VmResourcesForm( context['resources_form'] = VmResourcesForm(
can_edit=can_edit, instance=instance) can_edit=can_edit, instance=instance)
...@@ -173,11 +170,7 @@ class VmDetailView(LoginRequiredMixin, GraphMixin, DetailView): ...@@ -173,11 +170,7 @@ class VmDetailView(LoginRequiredMixin, GraphMixin, DetailView):
context['client_download'] = self.request.COOKIES.get( context['client_download'] = self.request.COOKIES.get(
'downloaded_client') 'downloaded_client')
# can link template # can link template
context['can_link_template'] = instance.template and is_operator context['can_link_template'] = instance.template
# is operator/owner
context['is_operator'] = is_operator
context['is_owner'] = is_owner
# operation also allows RUNNING (if with_shutdown is present) # operation also allows RUNNING (if with_shutdown is present)
context['save_resources_enabled'] = instance.status in ( context['save_resources_enabled'] = instance.status in (
...@@ -307,7 +300,7 @@ def get_operations(instance, user): ...@@ -307,7 +300,7 @@ def get_operations(instance, user):
try: try:
op = v.get_op_by_object(instance) op = v.get_op_by_object(instance)
# op.check_auth(user) # op.check_auth(user)
# op.check_precond() op.check_precond()
except PermissionDenied as e: except PermissionDenied as e:
logger.debug('Not showing operation %s for %s: %s', logger.debug('Not showing operation %s for %s: %s',
k, instance, unicode(e)) k, instance, unicode(e))
...@@ -743,26 +736,24 @@ vm_ops = OrderedDict([ ...@@ -743,26 +736,24 @@ vm_ops = OrderedDict([
('deploy', VmDeployView), ('deploy', VmDeployView),
('wake_up', VmOperationView.factory( ('wake_up', VmOperationView.factory(
op='wake_up', icon='sun-o', effect='success')), op='wake_up', icon='sun-o', effect='success')),
# ('sleep', VmOperationView.factory( ('sleep', VmOperationView.factory(
# extra_bases=[TokenOperationView], op='sleep', icon='moon-o', effect='info')),
# op='sleep', icon='moon-o', effect='info')),
# ('migrate', VmMigrateView), # ('migrate', VmMigrateView),
# ('save_as_template', VmSaveView), # ('save_as_template', VmSaveView),
# ('reboot', VmOperationView.factory( ('reboot', VmOperationView.factory(
# op='reboot', icon='refresh', effect='warning')), op='reboot', icon='refresh', effect='warning')),
# ('reset', VmOperationView.factory( # ('reset', VmOperationView.factory(
# op='reset', icon='bolt', effect='warning')), # op='reset', icon='bolt', effect='warning')),
# ('shutdown', VmOperationView.factory( # ('shutdown', VmOperationView.factory(
# op='shutdown', icon='power-off', effect='warning')), # op='shutdown', icon='power-off', effect='warning')),
# ('shut_off', VmOperationView.factory( ('shut_off', VmOperationView.factory(
# op='shut_off', icon='plug', effect='warning')), op='shut_off', icon='plug', effect='warning')),
# ('recover', VmOperationView.factory( # ('recover', VmOperationView.factory(
# op='recover', icon='medkit', effect='warning')), # op='recover', icon='medkit', effect='warning')),
# ('nostate', VmStateChangeView), # ('nostate', VmStateChangeView),
# ('redeploy', RedeployView), # ('redeploy', RedeployView),
# ('destroy', VmOperationView.factory( ('destroy', VmOperationView.factory(
# extra_bases=[TokenOperationView], op='destroy', icon='times', effect='danger')),
# op='destroy', icon='times', effect='danger')),
# ('create_disk', VmCreateDiskView), # ('create_disk', VmCreateDiskView),
# ('download_disk', VmDownloadDiskView), # ('download_disk', VmDownloadDiskView),
# ('resize_disk', VmDiskModifyView.factory( # ('resize_disk', VmDiskModifyView.factory(
...@@ -790,8 +781,8 @@ vm_ops = OrderedDict([ ...@@ -790,8 +781,8 @@ vm_ops = OrderedDict([
# )), # )),
# ('rename', VmRenameView), # ('rename', VmRenameView),
]) ])
#
#
def _get_activity_icon(act): def _get_activity_icon(act):
op = act.get_operation() op = act.get_operation()
if op and op.id in vm_ops: if op and op.id in vm_ops:
...@@ -1265,7 +1256,7 @@ def vm_activity(request, pk): ...@@ -1265,7 +1256,7 @@ def vm_activity(request, pk):
# activities = activities[:10] # activities = activities[:10]
response['connect_uri'] = instance.get_connect_uri() response['connect_uri'] = instance.get_connect_uri()
response['human_readable_status'] = instance.get_status_display() response['human_readable_status'] = '#TODO' #instance.get_status_display()
response['status'] = instance.status response['status'] = instance.status
response['icon'] = instance.get_status_icon() response['icon'] = instance.get_status_icon()
latest = instance.get_latest_activity_in_progress() latest = instance.get_latest_activity_in_progress()
...@@ -1275,8 +1266,8 @@ def vm_activity(request, pk): ...@@ -1275,8 +1266,8 @@ def vm_activity(request, pk):
context = { context = {
'instance': instance, 'instance': instance,
# 'activities': activities, 'activities': (),
# 'show_show_all': show_show_all, 'show_show_all': False,
'ops': get_operations(instance, request.user), 'ops': get_operations(instance, request.user),
} }
...@@ -1299,19 +1290,19 @@ def vm_activity(request, pk): ...@@ -1299,19 +1290,19 @@ def vm_activity(request, pk):
) )
# #
# #
# class FavouriteView(TemplateView): class FavouriteView(TemplateView):
#
# def post(self, *args, **kwargs): def post(self, *args, **kwargs):
# user = self.request.user user = self.request.user
# vm = Instance.objects.get(pk=self.request.POST.get("vm")) vm = Instance.objects.get(pk=self.request.POST.get("vm"))
# if not vm.has_level(user, 'user'): if not vm.has_level(user, 'user'):
# raise PermissionDenied() raise PermissionDenied()
# try: try:
# Favourite.objects.get(instance=vm, user=user).delete() Favourite.objects.get(instance=vm, user=user).delete()
# return HttpResponse("Deleted.") return HttpResponse("Deleted.")
# except Favourite.DoesNotExist: except Favourite.DoesNotExist:
# Favourite(instance=vm, user=user).save() Favourite(instance=vm, user=user).save()
# return HttpResponse("Added.") return HttpResponse("Added.")
# #
# #
# class TransferInstanceOwnershipConfirmView(TransferOwnershipConfirmView): # class TransferInstanceOwnershipConfirmView(TransferOwnershipConfirmView):
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-02-22 09:53
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('vm', '0005_remove_instance_owner'),
]
operations = [
migrations.RemoveField(
model_name='instance',
name='name',
),
]
...@@ -209,7 +209,7 @@ class InstanceTemplate(AclBase, VirtualMachineDescModel, TimeStampedModel): ...@@ -209,7 +209,7 @@ class InstanceTemplate(AclBase, VirtualMachineDescModel, TimeStampedModel):
return 'template.%d' % self.pk return 'template.%d' % self.pk
class Instance(AclBase, OperatedMixin, TimeStampedModel): class Instance(OperatedMixin, TimeStampedModel):
"""Virtual machine instance. """Virtual machine instance.
""" """
......
...@@ -27,6 +27,7 @@ from tarfile import TarFile, TarInfo ...@@ -27,6 +27,7 @@ from tarfile import TarFile, TarInfo
import time import time
from urlparse import urlsplit from urlparse import urlsplit
import openstack_api
from django.core.exceptions import PermissionDenied, SuspiciousOperation from django.core.exceptions import PermissionDenied, SuspiciousOperation
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.utils import timezone from django.utils import timezone
...@@ -42,7 +43,7 @@ from celery.exceptions import TimeLimitExceeded, TimeoutError ...@@ -42,7 +43,7 @@ from celery.exceptions import TimeLimitExceeded, TimeoutError
from common.models import ( from common.models import (
create_readable, humanize_exception, HumanReadableException create_readable, humanize_exception, HumanReadableException
) )
from common.operations import Operation, register_operation, SubOperationMixin from common.operations import Operation, register_operation
from manager.scheduler import SchedulerError from manager.scheduler import SchedulerError
from .tasks.local_tasks import ( from .tasks.local_tasks import (
abortable_async_instance_operation, abortable_async_node_operation, abortable_async_instance_operation, abortable_async_node_operation,
...@@ -96,7 +97,6 @@ class AbortableRemoteOperationMixin(object): ...@@ -96,7 +97,6 @@ class AbortableRemoteOperationMixin(object):
class InstanceOperation(Operation): class InstanceOperation(Operation):
acl_level = 'owner' acl_level = 'owner'
async_operation = abortable_async_instance_operation
host_cls = Instance host_cls = Instance
concurrency_check = True concurrency_check = True
accept_states = None accept_states = None
...@@ -108,9 +108,6 @@ class InstanceOperation(Operation): ...@@ -108,9 +108,6 @@ class InstanceOperation(Operation):
self.instance = instance self.instance = instance
def check_precond(self): def check_precond(self):
return
if self.instance.destroyed_at:
raise self.instance.InstanceDestroyedError(self.instance)
if self.accept_states: if self.accept_states:
if self.instance.status not in self.accept_states: if self.instance.status not in self.accept_states:
logger.debug("precond failed for %s: %s not in %s", logger.debug("precond failed for %s: %s not in %s",
...@@ -139,34 +136,14 @@ class InstanceOperation(Operation): ...@@ -139,34 +136,14 @@ class InstanceOperation(Operation):
not user.is_superuser): not user.is_superuser):
raise self.instance.WrongStateError(self.instance) raise self.instance.WrongStateError(self.instance)
def create_activity(self, parent, user, kwargs):
name = self.get_activity_name(kwargs)
if parent:
if parent.instance != self.instance:
raise ValueError("The instance associated with the specified "
"parent activity does not match the instance "
"bound to the operation.")
if parent.user != user:
raise ValueError("The user associated with the specified "
"parent activity does not match the user "
"provided as parameter.")
return parent.create_sub(
code_suffix=self.get_activity_code_suffix(),
readable_name=name, resultant_state=self.resultant_state)
else:
return InstanceActivity.create(
code_suffix=self.get_activity_code_suffix(),
instance=self.instance,
readable_name=name, user=user,
concurrency_check=self.concurrency_check,
resultant_state=self.resultant_state)
def is_preferred(self): def is_preferred(self):
"""If this is the recommended op in the current state of the instance. """If this is the recommended op in the current state of the instance.
""" """
return False return False
def get_from_os(self, request):
self.instance.get_from_os(request)
class RemoteInstanceOperation(RemoteOperationMixin, InstanceOperation): class RemoteInstanceOperation(RemoteOperationMixin, InstanceOperation):
...@@ -180,7 +157,7 @@ class RemoteInstanceOperation(RemoteOperationMixin, InstanceOperation): ...@@ -180,7 +157,7 @@ class RemoteInstanceOperation(RemoteOperationMixin, InstanceOperation):
class EnsureAgentMixin(object): class EnsureAgentMixin(object):
accept_states = ('RUNNING', ) accept_states = ('ACTIVE', )
def check_precond(self): def check_precond(self):
super(EnsureAgentMixin, self).check_precond() super(EnsureAgentMixin, self).check_precond()
...@@ -211,7 +188,7 @@ class AddInterfaceOperation(InstanceOperation): ...@@ -211,7 +188,7 @@ class AddInterfaceOperation(InstanceOperation):
description = _("Add a new network interface for the specified VLAN to " description = _("Add a new network interface for the specified VLAN to "
"the VM.") "the VM.")
required_perms = () required_perms = ()
accept_states = ('STOPPED', 'PENDING', 'RUNNING') accept_states = ('STOPPED', 'PENDING', 'ACTIVE')
def rollback(self, net, activity): def rollback(self, net, activity):
with activity.sub_activity( with activity.sub_activity(
...@@ -255,7 +232,7 @@ class CreateDiskOperation(InstanceOperation): ...@@ -255,7 +232,7 @@ class CreateDiskOperation(InstanceOperation):
name = _("create disk") name = _("create disk")
description = _("Create and attach empty disk to the virtual machine.") description = _("Create and attach empty disk to the virtual machine.")
required_perms = ('storage.create_empty_disk', ) required_perms = ('storage.create_empty_disk', )
accept_states = ('STOPPED', 'PENDING', 'RUNNING') accept_states = ('STOPPED', 'PENDING', 'ACTIVE')
def _operation(self, user, size, activity, name=None): def _operation(self, user, size, activity, name=None):
from storage.models import Disk from storage.models import Disk
...@@ -293,7 +270,7 @@ class ResizeDiskOperation(RemoteInstanceOperation): ...@@ -293,7 +270,7 @@ class ResizeDiskOperation(RemoteInstanceOperation):
description = _("Resize the virtual disk image. " description = _("Resize the virtual disk image. "
"Size must be greater value than the actual size.") "Size must be greater value than the actual size.")
required_perms = ('storage.resize_disk', ) required_perms = ('storage.resize_disk', )
accept_states = ('RUNNING', ) accept_states = ('ACTIVE', )
async_queue = "localhost.man.slow" async_queue = "localhost.man.slow"
remote_queue = ('vm', 'slow') remote_queue = ('vm', 'slow')
task = vm_tasks.resize_disk task = vm_tasks.resize_disk
...@@ -327,7 +304,7 @@ class DownloadDiskOperation(InstanceOperation): ...@@ -327,7 +304,7 @@ class DownloadDiskOperation(InstanceOperation):
abortable = True abortable = True
has_percentage = True has_percentage = True
required_perms = ('storage.download_disk', ) required_perms = ('storage.download_disk', )
accept_states = ('STOPPED', 'PENDING', 'RUNNING') accept_states = ('STOPPED', 'PENDING', 'ACTIVE')
async_queue = "localhost.man.slow" async_queue = "localhost.man.slow"
def _operation(self, user, url, task, activity, name=None): def _operation(self, user, url, task, activity, name=None):
...@@ -359,9 +336,14 @@ class DeployOperation(InstanceOperation): ...@@ -359,9 +336,14 @@ class DeployOperation(InstanceOperation):
name = _("deploy") name = _("deploy")
description = _("Deploy and start the virtual machine (including storage " description = _("Deploy and start the virtual machine (including storage "
"and network configuration).") "and network configuration).")
accept_states = ('SHUTOFF')
def _operation(self, activity, node=None): def is_preferred(self):
print("deploying vm") return (not self.instance.is_base and
self.instance.status == self.instance.STATUS.SHUTOFF)
def _operation(self, request, node=None):
openstack_api.nova.server_start(request, self.instance.os_server_id)
@register_operation @register_operation
class DestroyOperation(InstanceOperation): class DestroyOperation(InstanceOperation):
...@@ -376,57 +358,7 @@ class DestroyOperation(InstanceOperation): ...@@ -376,57 +358,7 @@ class DestroyOperation(InstanceOperation):
activity.resultant_state = None activity.resultant_state = None
def _operation(self, activity, system): def _operation(self, activity, system):
# Destroy networks pass
with activity.sub_activity(
'destroying_net',
readable_name=ugettext_noop("destroy network")):
if self.instance.node:
self.instance.shutdown_net()
self.instance.destroy_net()
if self.instance.node:
self.instance._delete_vm(parent_activity=activity)
# Destroy disks
with activity.sub_activity(
'destroying_disks',
readable_name=ugettext_noop("destroy disks")):
self.instance.destroy_disks()
# Delete mem. dump if exists
try:
self.instance._delete_mem_dump(parent_activity=activity)
except:
pass
# Clear node and VNC port association
self.instance.yield_node()
self.instance.yield_vnc_port()
self.instance.destroyed_at = timezone.now()
self.instance.save()
@register_operation
class DeleteVmOperation(SubOperationMixin, RemoteInstanceOperation):
id = "_delete_vm"
name = _("destroy virtual machine")
task = vm_tasks.destroy
# if e.libvirtError and "Domain not found" in str(e):
@register_operation
class DeleteMemDumpOperation(RemoteOperationMixin, SubOperationMixin,
InstanceOperation):
id = "_delete_mem_dump"
name = _("removing memory dump")
task = storage_tasks.delete_dump
def _get_remote_queue(self):
return self.instance.mem_dump['datastore'].get_remote_queue_name(
"storage", "fast")
def _get_remote_args(self, **kwargs):
return [self.instance.mem_dump['path']]
@register_operation @register_operation
class MigrateOperation(RemoteInstanceOperation): class MigrateOperation(RemoteInstanceOperation):
...@@ -436,7 +368,7 @@ class MigrateOperation(RemoteInstanceOperation): ...@@ -436,7 +368,7 @@ class MigrateOperation(RemoteInstanceOperation):
"keeping its full state.") "keeping its full state.")
required_perms = () required_perms = ()
superuser_required = True superuser_required = True
accept_states = ('RUNNING', ) accept_states = ('ACTIVE', )
async_queue = "localhost.man.slow" async_queue = "localhost.man.slow"
task = vm_tasks.migrate task = vm_tasks.migrate
remote_queue = ("vm", "slow") remote_queue = ("vm", "slow")
...@@ -489,20 +421,15 @@ class MigrateOperation(RemoteInstanceOperation): ...@@ -489,20 +421,15 @@ class MigrateOperation(RemoteInstanceOperation):
@register_operation @register_operation
class RebootOperation(RemoteInstanceOperation): class RebootOperation(InstanceOperation):
id = 'reboot' id = 'reboot'
name = _("reboot") name = _("reboot")
description = _("Warm reboot virtual machine by sending Ctrl+Alt+Del " description = _("Warm reboot virtual machine by sending Ctrl+Alt+Del "
"signal to its console.") "signal to its console.")
required_perms = () accept_states = ('ACTIVE', )
accept_states = ('RUNNING', )
task = vm_tasks.reboot
def _operation(self, activity): def _operation(self, activity):
super(RebootOperation, self)._operation() pass
if self.instance.has_agent:
activity.sub_activity('os_boot', readable_name=ugettext_noop(
"wait operating system loading"), interruptible=True)
@register_operation @register_operation
...@@ -513,7 +440,7 @@ class RemoveInterfaceOperation(InstanceOperation): ...@@ -513,7 +440,7 @@ class RemoveInterfaceOperation(InstanceOperation):
"address allocations, related firewall rules and " "address allocations, related firewall rules and "
"hostnames.") "hostnames.")
required_perms = () required_perms = ()
accept_states = ('STOPPED', 'PENDING', 'RUNNING') accept_states = ('STOPPED', 'PENDING', 'ACTIVE')
def _operation(self, activity, user, system, interface): def _operation(self, activity, user, system, interface):
if self.instance.is_running: if self.instance.is_running:
...@@ -573,7 +500,7 @@ class RemoveDiskOperation(InstanceOperation): ...@@ -573,7 +500,7 @@ class RemoveDiskOperation(InstanceOperation):
description = _("Remove the specified disk from the virtual machine, and " description = _("Remove the specified disk from the virtual machine, and "
"destroy the data.") "destroy the data.")
required_perms = () required_perms = ()
accept_states = ('STOPPED', 'PENDING', 'RUNNING') accept_states = ('STOPPED', 'PENDING', 'ACTIVE')
def _operation(self, activity, user, system, disk): def _operation(self, activity, user, system, disk):
if self.instance.is_running and disk.type not in ["iso"]: if self.instance.is_running and disk.type not in ["iso"]:
...@@ -596,7 +523,7 @@ class ResetOperation(RemoteInstanceOperation): ...@@ -596,7 +523,7 @@ class ResetOperation(RemoteInstanceOperation):
name = _("reset") name = _("reset")
description = _("Cold reboot virtual machine (power cycle).") description = _("Cold reboot virtual machine (power cycle).")
required_perms = () required_perms = ()
accept_states = ('RUNNING', ) accept_states = ('ACTIVE', )
task = vm_tasks.reset task = vm_tasks.reset
def _operation(self, activity): def _operation(self, activity):
...@@ -617,7 +544,7 @@ class SaveAsTemplateOperation(InstanceOperation): ...@@ -617,7 +544,7 @@ class SaveAsTemplateOperation(InstanceOperation):
has_percentage = True has_percentage = True
abortable = True abortable = True
required_perms = ('vm.create_template', ) required_perms = ('vm.create_template', )
accept_states = ('RUNNING', 'STOPPED') accept_states = ('ACTIVE', 'STOPPED')
async_queue = "localhost.man.slow" async_queue = "localhost.man.slow"
def is_preferred(self): def is_preferred(self):
...@@ -728,7 +655,7 @@ class ShutdownOperation(AbortableRemoteOperationMixin, ...@@ -728,7 +655,7 @@ class ShutdownOperation(AbortableRemoteOperationMixin,
"turn itself off in a period.") "turn itself off in a period.")
abortable = True abortable = True
required_perms = () required_perms = ()
accept_states = ('RUNNING', ) accept_states = ('ACTIVE', )
resultant_state = 'STOPPED' resultant_state = 'STOPPED'
task = vm_tasks.shutdown task = vm_tasks.shutdown
remote_queue = ("vm", "slow") remote_queue = ("vm", "slow")
...@@ -761,20 +688,10 @@ class ShutOffOperation(InstanceOperation): ...@@ -761,20 +688,10 @@ class ShutOffOperation(InstanceOperation):
"so data loss is also possible. The effect of this " "so data loss is also possible. The effect of this "
"operation is the same as interrupting the power supply " "operation is the same as interrupting the power supply "
"of a physical machine.") "of a physical machine.")
required_perms = () accept_states = ('ACTIVE', 'PAUSED')
accept_states = ('RUNNING', 'PAUSED')
resultant_state = 'STOPPED'
def _operation(self, activity):
# Shutdown networks
with activity.sub_activity('shutdown_net',
readable_name=ugettext_noop(
"shutdown network")):
self.instance.shutdown_net()
self.instance._delete_vm(parent_activity=activity)
self.instance.yield_node()
def _operation(self, request):
openstack_api.nova.server_stop(request, self.instance.os_server_id)
@register_operation @register_operation
class SleepOperation(InstanceOperation): class SleepOperation(InstanceOperation):
...@@ -788,10 +705,7 @@ class SleepOperation(InstanceOperation): ...@@ -788,10 +705,7 @@ class SleepOperation(InstanceOperation):
"need a continous network connection may fail when " "need a continous network connection may fail when "
"resumed. In the meantime, the machine will only use " "resumed. In the meantime, the machine will only use "
"storage resources, and keep network resources allocated.") "storage resources, and keep network resources allocated.")
required_perms = () accept_states = ('ACTIVE', )
accept_states = ('RUNNING', )
resultant_state = 'SUSPENDED'
async_queue = "localhost.man.slow"
def is_preferred(self): def is_preferred(self):
return (not self.instance.is_base and return (not self.instance.is_base and
...@@ -804,25 +718,7 @@ class SleepOperation(InstanceOperation): ...@@ -804,25 +718,7 @@ class SleepOperation(InstanceOperation):
activity.resultant_state = 'ERROR' activity.resultant_state = 'ERROR'
def _operation(self, activity, system): def _operation(self, activity, system):
with activity.sub_activity('shutdown_net', pass
readable_name=ugettext_noop(
"shutdown network")):
self.instance.shutdown_net()
self.instance._suspend_vm(parent_activity=activity)
self.instance.yield_node()
@register_operation
class SuspendVmOperation(SubOperationMixin, RemoteInstanceOperation):
id = "_suspend_vm"
name = _("suspend virtual machine")
task = vm_tasks.sleep
remote_queue = ("vm", "slow")
remote_timeout = 1000
def _get_remote_args(self, **kwargs):
return (super(SleepOperation.SuspendVmOperation, self)
._get_remote_args(**kwargs) +
[self.instance.mem_dump['path']])
@register_operation @register_operation
...@@ -834,8 +730,6 @@ class WakeUpOperation(InstanceOperation): ...@@ -834,8 +730,6 @@ class WakeUpOperation(InstanceOperation):
"virtual machine from this state.") "virtual machine from this state.")
required_perms = () required_perms = ()
accept_states = ('SUSPENDED', ) accept_states = ('SUSPENDED', )
resultant_state = 'RUNNING'
async_queue = "localhost.man.slow"
def is_preferred(self): def is_preferred(self):
return self.instance.status == self.instance.STATUS.SUSPENDED return self.instance.status == self.instance.STATUS.SUSPENDED
...@@ -847,36 +741,7 @@ class WakeUpOperation(InstanceOperation): ...@@ -847,36 +741,7 @@ class WakeUpOperation(InstanceOperation):
activity.resultant_state = 'ERROR' activity.resultant_state = 'ERROR'
def _operation(self, activity): def _operation(self, activity):
# Schedule vm pass
self.instance.allocate_vnc_port()
self.instance.allocate_node()
# Resume vm
self.instance._wake_up_vm(parent_activity=activity)
# Estabilish network connection (vmdriver)
with activity.sub_activity(
'deploying_net', readable_name=ugettext_noop(
"deploy network")):
self.instance.deploy_net()
try:
self.instance.renew(parent_activity=activity)
except:
pass
@register_operation
class WakeUpVmOperation(SubOperationMixin, RemoteInstanceOperation):
id = "_wake_up_vm"
name = _("resume virtual machine")
task = vm_tasks.wake_up
remote_queue = ("vm", "slow")
remote_timeout = 1000
def _get_remote_args(self, **kwargs):
return (super(WakeUpOperation.WakeUpVmOperation, self)
._get_remote_args(**kwargs) +
[self.instance.mem_dump['path']])
@register_operation @register_operation
...@@ -1226,7 +1091,7 @@ class ScreenshotOperation(RemoteInstanceOperation): ...@@ -1226,7 +1091,7 @@ class ScreenshotOperation(RemoteInstanceOperation):
"screensaver.") "screensaver.")
acl_level = "owner" acl_level = "owner"
required_perms = () required_perms = ()
accept_states = ('RUNNING', ) accept_states = ('ACTIVE', )
task = vm_tasks.screenshot task = vm_tasks.screenshot
...@@ -1278,12 +1143,12 @@ class ResourcesOperation(InstanceOperation): ...@@ -1278,12 +1143,12 @@ class ResourcesOperation(InstanceOperation):
description = _("Change resources of a stopped virtual machine.") description = _("Change resources of a stopped virtual machine.")
acl_level = "owner" acl_level = "owner"
required_perms = ('vm.change_resources', ) required_perms = ('vm.change_resources', )
accept_states = ('STOPPED', 'PENDING', 'RUNNING') accept_states = ('STOPPED', 'PENDING', 'ACTIVE')
def _operation(self, user, activity, def _operation(self, user, activity,
num_cores, ram_size, max_ram_size, priority, num_cores, ram_size, max_ram_size, priority,
with_shutdown=False, task=None): with_shutdown=False, task=None):
if self.instance.status == 'RUNNING' and not with_shutdown: if self.instance.status == 'ACTIVE' and not with_shutdown:
raise Instance.WrongStateError(self.instance) raise Instance.WrongStateError(self.instance)
try: try:
...@@ -1427,88 +1292,7 @@ class AgentStartedOperation(InstanceOperation): ...@@ -1427,88 +1292,7 @@ class AgentStartedOperation(InstanceOperation):
i.finish(True) i.finish(True)
def _operation(self, user, activity, old_version=None, agent_system=None): def _operation(self, user, activity, old_version=None, agent_system=None):
with activity.sub_activity('starting', concurrency_check=False, pass
readable_name=ugettext_noop('starting')):
pass
self.finish_agent_wait()
self.instance._change_ip(parent_activity=activity)
self.instance._restart_networking(parent_activity=activity)
new_version = settings.AGENT_VERSION
if new_version and old_version and new_version != old_version:
try:
self.instance.update_agent(
parent_activity=activity, agent_system=agent_system)
except TimeoutError:
pass
else:
activity.sub_activity(
'agent_wait', readable_name=ugettext_noop(
"wait agent restarting"), interruptible=True)
return # agent is going to restart
if not self.initialized:
try:
self.measure_boot_time()
except:
logger.exception('Unhandled error in measure_boot_time()')
self.instance._cleanup(parent_activity=activity)
self.instance.password_reset(
parent_activity=activity, password=self.instance.pw)
self.instance.install_keys(parent_activity=activity)
self.instance._set_time(parent_activity=activity)
self.instance._set_hostname(parent_activity=activity)
@register_operation
class CleanupOperation(SubOperationMixin, RemoteAgentOperation):
id = '_cleanup'
name = _("cleanup")
task = agent_tasks.cleanup
@register_operation
class SetTimeOperation(SubOperationMixin, RemoteAgentOperation):
id = '_set_time'
name = _("set time")
task = agent_tasks.set_time
def _get_remote_args(self, **kwargs):
cls = AgentStartedOperation.SetTimeOperation
return (super(cls, self)._get_remote_args(**kwargs) +
[time.time()])
@register_operation
class SetHostnameOperation(SubOperationMixin, RemoteAgentOperation):
id = '_set_hostname'
name = _("set hostname")
task = agent_tasks.set_hostname
def _get_remote_args(self, **kwargs):
cls = AgentStartedOperation.SetHostnameOperation
return (super(cls, self)._get_remote_args(**kwargs) +
[self.instance.short_hostname])
@register_operation
class RestartNetworkingOperation(SubOperationMixin, RemoteAgentOperation):
id = '_restart_networking'
name = _("restart networking")
task = agent_tasks.restart_networking
@register_operation
class ChangeIpOperation(SubOperationMixin, RemoteAgentOperation):
id = '_change_ip'
name = _("change ip")
task = agent_tasks.change_ip
def _get_remote_args(self, **kwargs):
hosts = Host.objects.filter(interface__instance=self.instance)
interfaces = {str(host.mac): host.get_network_config()
for host in hosts}
cls = AgentStartedOperation.ChangeIpOperation
return (super(cls, self)._get_remote_args(**kwargs) +
[interfaces, settings.FIREWALL_SETTINGS['rdns_ip']])
@register_operation @register_operation
class UpdateAgentOperation(RemoteAgentOperation): class UpdateAgentOperation(RemoteAgentOperation):
...@@ -1627,7 +1411,7 @@ class MountStoreOperation(EnsureAgentMixin, InstanceOperation): ...@@ -1627,7 +1411,7 @@ class MountStoreOperation(EnsureAgentMixin, InstanceOperation):
queue=queue, args=(inst.vm_name, host, username, password)) queue=queue, args=(inst.vm_name, host, username, password))
class AbstractDiskOperation(SubOperationMixin, RemoteInstanceOperation): class AbstractDiskOperation(RemoteInstanceOperation):
required_perms = () required_perms = ()
def _get_remote_args(self, disk, **kwargs): def _get_remote_args(self, disk, **kwargs):
...@@ -1663,7 +1447,7 @@ class DetachDisk(DetachMixin, AbstractDiskOperation): ...@@ -1663,7 +1447,7 @@ class DetachDisk(DetachMixin, AbstractDiskOperation):
task = vm_tasks.detach_disk task = vm_tasks.detach_disk
class AbstractNetworkOperation(SubOperationMixin, RemoteInstanceOperation): class AbstractNetworkOperation(RemoteInstanceOperation):
required_perms = () required_perms = ()
def _get_remote_args(self, interface, **kwargs): def _get_remote_args(self, interface, **kwargs):
......
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