Just ran into an interesting bug in 9.3P17 (yes, I'm off support!) and another 9.5P5 system which I thought I'd share.
Let's grab all the export policies on the system in CSV format to make it easy to parse:
ntap1::> set -showseparator ","; export-policy show
Vserver Policy Name --------------- ------------------- foo default
WTF? That's wierd? Let's try something else:
ntap1::> set -showseparator ","; export-policy show -fields vserver ,policyname
vserver,policyname, Vserver,Policy Name, foo,default,
Ah! Now we're getting what we want. Stupid annoying bug when you're trying to write a perl script to pull out data. Can anyone confirm if this is still there in the latest releases?
Hmm... poking at it some more... I suspect I'm forgetting that you *must* specify the fields when changing the -showseparator to get easier to parse output. But I still think this is a surprising occurance, since it does include the field names, so there's no need to actually specify them in the output.
Principal of least surprise and all that.
Cheers, John
Just tried in 9.7P11
knoxsahrc09l99::> set -showseparator ","
knoxsahrc09l99::> export-policy show Vserver Policy Name --------------- ------------------- esxi_boot default
knoxsahrc09l99::> set -showseparator "--"
knoxsahrc09l99::> export-policy show Vserver Policy Name --------------- ------------------- esxi_boot default
knoxsahrc09l99::> export-policy show -fields vserver ,policyname vserver--policyname-- Vserver--Policy Name-- esxi_boot--default--
knoxsahrc09l99::> set -showseparator " "
knoxsahrc09l99::> export-policy show -fields vserver ,policyname vserver policyname --------- ---------- esxi_boot default
--tmac
*Tim McCarthy, **Principal Consultant*
*Proud Member of the #NetAppATeam https://twitter.com/NetAppATeam*
*I Blog at TMACsRack https://tmacsrack.wordpress.com/*
On Fri, Feb 12, 2021 at 11:58 AM John Stoffel john@stoffel.org wrote:
Just ran into an interesting bug in 9.3P17 (yes, I'm off support!) and another 9.5P5 system which I thought I'd share.
Let's grab all the export policies on the system in CSV format to make it easy to parse:
ntap1::> set -showseparator ","; export-policy show Vserver Policy Name --------------- ------------------- foo default
WTF? That's wierd? Let's try something else:
ntap1::> set -showseparator ","; export-policy show -fields vserver ,policyname vserver,policyname, Vserver,Policy Name, foo,default,
Ah! Now we're getting what we want. Stupid annoying bug when you're trying to write a perl script to pull out data. Can anyone confirm if this is still there in the latest releases?
Hmm... poking at it some more... I suspect I'm forgetting that you *must* specify the fields when changing the -showseparator to get easier to parse output. But I still think this is a surprising occurance, since it does include the field names, so there's no need to actually specify them in the output.
Principal of least surprise and all that.
Cheers, John _______________________________________________ Toasters mailing list Toasters@teaparty.net https://www.teaparty.net/mailman/listinfo/toasters
Thanks for checking, I think it's a bug myself... but I can see how it might be considered a feature of some sort.
"tmac" == tmac tmacmd@gmail.com writes:
tmac> Just tried in 9.7P11
tmac> knoxsahrc09l99::> set -showseparator ","
tmac> knoxsahrc09l99::> export-policy show tmac> Vserver Policy Name tmac> --------------- ------------------- tmac> esxi_boot default
tmac> knoxsahrc09l99::> set -showseparator "--"
tmac> knoxsahrc09l99::> export-policy show tmac> Vserver Policy Name tmac> --------------- ------------------- tmac> esxi_boot default
tmac> knoxsahrc09l99::> export-policy show -fields vserver ,policyname tmac> vserver--policyname-- tmac> Vserver--Policy Name-- tmac> esxi_boot--default--
tmac> knoxsahrc09l99::> set -showseparator " "
tmac> knoxsahrc09l99::> export-policy show -fields vserver ,policyname tmac> vserver policyname tmac> --------- ---------- tmac> esxi_boot default
tmac> --tmac
tmac> Tim McCarthy, Principal Consultant
tmac> Proud Member of the #NetAppATeam
tmac> I Blog at TMACsRack
tmac> On Fri, Feb 12, 2021 at 11:58 AM John Stoffel john@stoffel.org wrote:
tmac> Just ran into an interesting bug in 9.3P17 (yes, I'm off support!) tmac> and another 9.5P5 system which I thought I'd share.
tmac> Let's grab all the export policies on the system in CSV format to make tmac> it easy to parse:
tmac> ntap1::> set -showseparator ","; export-policy show
tmac> Vserver Policy Name tmac> --------------- ------------------- tmac> foo default
tmac> WTF? That's wierd? Let's try something else:
tmac> ntap1::> set -showseparator ","; export-policy show -fields vserver tmac> ,policyname
tmac> vserver,policyname, tmac> Vserver,Policy Name, tmac> foo,default,
tmac> Ah! Now we're getting what we want. Stupid annoying bug when you're tmac> trying to write a perl script to pull out data. Can anyone confirm if tmac> this is still there in the latest releases?
tmac> Hmm... poking at it some more... I suspect I'm forgetting that you tmac> *must* specify the fields when changing the -showseparator to get tmac> easier to parse output. But I still think this is a surprising tmac> occurance, since it does include the field names, so there's no need tmac> to actually specify them in the output.
tmac> Principal of least surprise and all that.
tmac> Cheers, tmac> John tmac> _______________________________________________ tmac> Toasters mailing list tmac> Toasters@teaparty.net tmac> https://www.teaparty.net/mailman/listinfo/toasters