Merge "Require a backup name for backup/restore/admin"

This commit is contained in:
Jenkins 2016-08-30 10:42:04 +00:00 committed by Gerrit Code Review
commit 5eff0b9d9a
1 changed files with 5 additions and 1 deletions

View File

@ -65,10 +65,14 @@ class Job(object):
Apply general validation rules.
:return: True or raise an error
"""
LOG.info("Validating args for the {0} job.".format(self.conf.action))
if not self.conf.action:
raise ValueError("Please provide a valid action with --action")
LOG.info("Validating args for the {0} job.".format(self.conf.action))
if self.conf.action in ('backup', 'restore', 'admin') \
and self.conf.backup_media == 'fs' \
and not self.conf.backup_name:
raise ValueError('A value for --backup-name is required')
@abc.abstractmethod
def execute(self):