From 44e53e7e2037dbd4af5e85c5a60d7ae7d3126247 Mon Sep 17 00:00:00 2001 From: NojuHD Date: Fri, 7 Feb 2025 21:41:14 -0500 Subject: [PATCH] Fix typos & change name scheme --- PureStoragePlugin.pm | 22 +++++++++++----------- README.md | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PureStoragePlugin.pm b/PureStoragePlugin.pm index 6ddb05f..09bda4a 100644 --- a/PureStoragePlugin.pm +++ b/PureStoragePlugin.pm @@ -101,9 +101,9 @@ sub properties { default => "no" }, protocol => { - description => "Set storage protocol (1 = iscsi | 2 = scsi | 3 = nvme)", - type => "integer", - default => 1 + description => "Set storage protocol ( iscsi | fc | nvme )", + type => "string", + default => "iscsi" }, }; } @@ -643,12 +643,12 @@ sub purestorage_resize_volume { my ( $path, $wwid ) = $class->purestorage_get_wwn( $scfg, $volname ); my $protocol = $scfg->{ protocol }; - if ( $protocol == 1 ) { + if ( $protocol eq 'iscsi' ) { exec_command( [ $cmd->{ iscsiadm }, '--mode', 'node', '--rescan' ], 1 ); - } elsif ( $protocol == 2 ) { + } elsif ( $protocol eq 'fc' ) { scsi_rescan_device( $wwid ); - } elsif ( $protocol == 3 ) { - die qq{"Error :: Protocol: "$protocol" isn't implemented yet.\n}; + } elsif ( $protocol eq 'nvme' ) { + die qq{Error :: Protocol: "$protocol" isn't implemented yet.\n}; } else { die qq{Error :: Protocol: "$protocol" isn't a valid protocol.\n}; } @@ -976,12 +976,12 @@ sub map_volume { exec_command( [ $cmd->{ multipath }, '-a', $wwid ], 1 ); my $protocol = $scfg->{ protocol }; - if ( $protocol == 1 ) { + if ( $protocol eq 'iscsi' ) { exec_command( [ $cmd->{ iscsiadm }, '--mode', 'session', '--rescan' ], 1 ); - } elsif ( $protocol == 2 ) { + } elsif ( $protocol eq 'fc' ) { scsi_scan_new(); - } elsif ( $protocol == 3 ) { - die qq{"Error :: Protocol: "$protocol" isn't implemented yet.\n}; + } elsif ( $protocol eq 'nvme' ) { + die qq{Error :: Protocol: "$protocol" isn't implemented yet.\n}; } else { die qq{Error :: Protocol: "$protocol" isn't a valid protocol.\n}; } diff --git a/README.md b/README.md index 171e1f3..d599045 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ purestorage: | vnprefix | (`optional`) The prefix to prepend to name of virtual disks. | | hgsuffix | (`optional`) A suffix that is appended to the hostname when the plugin interacts with the Pure Storage array. This can help differentiate hosts if necessary. | | content | Specifies the types of content that can be stored. For virtual machine disk images, use images. | -| protocol | (`optional`, default is `iscsi`) Specifies the storage protocol (1 = iscsi, 2 = scsi) | +| protocol | (`optional`, default is `iscsi`) Specifies the storage protocol (iscsi, fc) | > **_NOTE:_** Ensure that the token and other sensitive information are kept secure and not exposed publicly.