Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have cloned the "create export" command to make it more secure as per our needs. I was wondering if there are any immediate issues with this simple code? It simply ensures that there is no world RW or RO export as it is not acceptable in the automated deployment environment we have.
if ($Anon)
{
$expression += " -Anon " + $Anon
}
##
##New code begin
##
If ( ( $Roothosts ) -and ( !$RWhosts ) ) {
$RWhosts = $Roothosts
}
##
##New code end
##
if(!$RWhosts -and !$ROhosts)
{
$RWhosts = "all-hosts"
}
Solved! See The Solution
1 ACCEPTED SOLUTION
migration has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Scott,
Your code looks fine and there do not seem to be any issues.
Tested it briefly and it works as expected when "Roothosts" is defined.
Providing the relevant snippet of the command test log below:
"Add-NaNfsExport -Persistent -Path /vol/testvol -Root @('1.1.1.1') -ReadOnly @() -ReadWrite @('1.1.1.1')"
FYI (in case you have missed it): WFA provides a "Test" feature per command for the very purpose mentioned in this thread.
Regards,
Tanzim
4 REPLIES 4
migration has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Scott,
Your code looks fine and there do not seem to be any issues.
Tested it briefly and it works as expected when "Roothosts" is defined.
Providing the relevant snippet of the command test log below:
"Add-NaNfsExport -Persistent -Path /vol/testvol -Root @('1.1.1.1') -ReadOnly @() -ReadWrite @('1.1.1.1')"
FYI (in case you have missed it): WFA provides a "Test" feature per command for the very purpose mentioned in this thread.
Regards,
Tanzim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Tanzim,
I have tested the command, previewed and executed the workflow under our existing 1.1.1 and our test 2.0 WFA. I simply needed another set of eyes to be certain that I was not missing something.
-Scott
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Scott,
Another point worth noting:
Cloned commands do not retain the Reservation characteristics that certified commands have.
Not sure if that's overly critical with said command, but worth noting.
BTW - You could have done that in the define of the export as well, and then retain the usage of our certified command:
For the RWHosts write something like
$RWHosts == "" ? $RootHosts : $RWHosts
Here's a screen cap of the definition and the results (When RootHosts contain data while RWHosts is empty):
Hope that helps.
Yaron Haimsohn
WFA Team
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Yaron!
I didn't even think about using the variable in the find chart to correct it. I am going to use this method so that I still am using the certified command structure.
Many thanks,
Scott
