Skip to content

Commit

Permalink
VMware Plugin: Code formatting and copyright year
Browse files Browse the repository at this point in the history
Code formatting with black and copyright year to comply with
coding guidelines.
  • Loading branch information
sduehr committed Aug 22, 2022
1 parent 693ee8d commit 2f1aa09
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions core/src/plugins/filed/python/vmware/BareosFdPluginVMware.py
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# BAREOS - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2014-2020 Bareos GmbH & Co. KG
# Copyright (C) 2014-2022 Bareos GmbH & Co. KG
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -224,7 +224,10 @@ def check_plugin_options(self, mandatory_options=None):
mandatory_options += self.mandatory_options_vmname

if self.options.get("localvmdk") == "yes":
mandatory_options = list(set(mandatory_options) - set(["vcserver", "vcuser", "vcpass", "folder", "dc", "vmname"]))
mandatory_options = list(
set(mandatory_options)
- set(["vcserver", "vcuser", "vcpass", "folder", "dc", "vmname"])
)

for option in mandatory_options:
if option not in self.options:
Expand Down Expand Up @@ -262,7 +265,10 @@ def check_plugin_options(self, mandatory_options=None):
% (option, StringCodec.encode(self.options[option])),
)

if not self.options.get("localvmdk") == "yes" and "vcthumbprint" not in self.options:
if (
not self.options.get("localvmdk") == "yes"
and "vcthumbprint" not in self.options
):
# if vcthumbprint is not given in options, retrieve it
if not self.vadp.retrieve_vcthumbprint():
return bareosfd.bRC_Error
Expand Down Expand Up @@ -383,7 +389,10 @@ def start_restore_job(self):
if check_option_bRC != bareosfd.bRC_OK:
return check_option_bRC

if not self.options.get("localvmdk") == "yes" and not self.vadp.connect_vmware():
if (
not self.options.get("localvmdk") == "yes"
and not self.vadp.connect_vmware()
):
return bareosfd.bRC_Error

return self.vadp.prepare_vm_restore()
Expand Down

0 comments on commit 2f1aa09

Please sign in to comment.