Skip to content

Commit

Permalink
add check for nfs_client_vm_cloud/name parameters
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Horak <[email protected]>
  • Loading branch information
dahorak committed Jul 23, 2024
1 parent ee8f709 commit b43c826
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

from ocs_ci.ocs.resources import pod, ocs
from ocs_ci.utility.retry import retry
from ocs_ci.ocs.exceptions import CommandFailed
from ocs_ci.ocs.exceptions import CommandFailed, ConfigurationError


log = logging.getLogger(__name__)
Expand Down Expand Up @@ -212,6 +212,11 @@ def con(self):
except (TimeoutError, socket.gaierror):
nfs_client_vm_cloud = config.ENV_DATA.get("nfs_client_vm_cloud")
nfs_client_vm_name = config.ENV_DATA.get("nfs_client_vm_name")
if not nfs_client_vm_cloud or not nfs_client_vm_name:
raise ConfigurationError(
"NFS Client VM is not accessible and ENV_DATA nfs_client_vm_cloud and/or nfs_client_vm_name "
"parameters are not configured to be able to automatically reboot the NFS Client VM."
)
cmd = f"openstack --os-cloud {nfs_client_vm_cloud} server reboot --hard --wait {nfs_client_vm_name}"
exec_cmd(cmd)

Expand Down

0 comments on commit b43c826

Please sign in to comment.