Simplify snapshot configuration for actions
Resolves bug: 1533707 Change-Id: I4ebc710ebba8a392acc226cc18dcfbd323d08afd
This commit is contained in:
parent
fc5d38a483
commit
e8756ee635
@ -258,7 +258,7 @@ class ActionConfiguration(workflows.Step):
|
|||||||
|
|
||||||
|
|
||||||
class SnapshotConfigurationAction(workflows.Action):
|
class SnapshotConfigurationAction(workflows.Action):
|
||||||
use_snapshot = forms.BooleanField(
|
snapshot = forms.BooleanField(
|
||||||
label=_("Snapshot"),
|
label=_("Snapshot"),
|
||||||
help_text=_("Use a LVM or Shadow Copy snapshot "
|
help_text=_("Use a LVM or Shadow Copy snapshot "
|
||||||
"to have point in time consistent backups"),
|
"to have point in time consistent backups"),
|
||||||
@ -266,13 +266,6 @@ class SnapshotConfigurationAction(workflows.Action):
|
|||||||
initial=False,
|
initial=False,
|
||||||
required=False)
|
required=False)
|
||||||
|
|
||||||
is_windows = forms.BooleanField(
|
|
||||||
label=_("Job For Windows"),
|
|
||||||
help_text=_("Is this job going to "
|
|
||||||
"execute on windows?"),
|
|
||||||
widget=forms.CheckboxInput(),
|
|
||||||
required=False)
|
|
||||||
|
|
||||||
class Meta(object):
|
class Meta(object):
|
||||||
name = _("Snapshot")
|
name = _("Snapshot")
|
||||||
help_text_template = "disaster_recovery/jobs" \
|
help_text_template = "disaster_recovery/jobs" \
|
||||||
@ -281,9 +274,7 @@ class SnapshotConfigurationAction(workflows.Action):
|
|||||||
|
|
||||||
class SnapshotConfiguration(workflows.Step):
|
class SnapshotConfiguration(workflows.Step):
|
||||||
action_class = SnapshotConfigurationAction
|
action_class = SnapshotConfigurationAction
|
||||||
contributes = ('use_snapshot',
|
contributes = ('snapshot',)
|
||||||
'is_windows',
|
|
||||||
'is_linux')
|
|
||||||
|
|
||||||
|
|
||||||
class AdvancedConfigurationAction(workflows.Action):
|
class AdvancedConfigurationAction(workflows.Action):
|
||||||
@ -540,20 +531,6 @@ class ActionWorkflow(workflows.Workflow):
|
|||||||
|
|
||||||
def handle(self, request, context):
|
def handle(self, request, context):
|
||||||
try:
|
try:
|
||||||
if context['is_windows']:
|
|
||||||
client_os = 'Windows'
|
|
||||||
else:
|
|
||||||
client_os = 'Linux'
|
|
||||||
|
|
||||||
if context['use_snapshot'] and client_os == 'Windows':
|
|
||||||
context['vssadmin'] = True
|
|
||||||
context.pop('use_snapshot')
|
|
||||||
elif context['use_snapshot'] and client_os == 'Linux':
|
|
||||||
context['snapshot'] = True
|
|
||||||
context.pop('use_snapshot')
|
|
||||||
else:
|
|
||||||
context.pop('use_snapshot')
|
|
||||||
|
|
||||||
if context['action_id'] == '':
|
if context['action_id'] == '':
|
||||||
freezer_api.Action(request).create(context)
|
freezer_api.Action(request).create(context)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user