4 Replies Latest reply: Jan 24, 2013 12:44 PM by cscott RSS

Create export command update

cscott
Currently Being Moderated

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"

}

  • Re: Create export command update
    tanzim
    Currently Being Moderated

    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

    • Re: Create export command update
      cscott
      Currently Being Moderated

      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

      • Re: Create export command update
        Yaron Haimsohn
        Currently Being Moderated

        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):

        exp-def.png

         

        exp-result.png

        Hope that helps.

         

        Yaron Haimsohn

        WFA Team

More Like This

  • Retrieving data ...