Software Development Kit (SDK) and API Discussions

Perl SDK warnings under strict

FULLSTEAM
2,388 Views

Actual question I have: what's the right way to report an SDK bug?  This is the second time I've found an SDK issue, and last time I tried, Support seemed BEYOND confused that I don't have a filer problem, I don't have a serial to tag it against, and I don't want help with scripting.. I just want them to BURT something.

 

 

5.6 Perl SDK, running scripts with 'use warnings' and 'use strict', in a script that's invoking aggregate_list against OCUM-cDOT 7.0:

 

Use of uninitialized value $flag in bitwise and (&) at /usr/lib64/perl5/vendor_perl/NetApp-SDK/OCUMAPI.pm line 5378.

That bit is:

sub IsArrayFlag {
    my ($self, $flag) = @_;
    return ($flag & FIELD_ARRAY) == FIELD_ARRAY;
}

 

That's coming from NaElement.pm,

if ($key_field and $all_api_bindings->IsArrayFlag($key_field->{flags})) {

 

Here the code gets a little spaghetti, and my eyes are crossing, but I -think- the issue is around line 438, there's

if(ref($existing_value) eq "ARRAY") {

with a simple 'else' later.

 

But aggregate-info returns a hash, not a scalar or an array.

Really don't want to beat my head on a support case if someone's got a direct line to a developer here, but I will if I must.

1 REPLY 1

FULLSTEAM
2,255 Views

Hamfisted workaround:

 

--- OCUMAPI.pm.orig	2016-11-18 05:31:30.064255227 +0000
+++ OCUMAPI.pm	2016-11-18 18:24:55.278917142 +0000
@@ -5375,7 +5375,7 @@

 sub IsArrayFlag {
     my ($self, $flag) = @_;
-    return ($flag & FIELD_ARRAY) == FIELD_ARRAY;
+    return $flag ? (($flag & FIELD_ARRAY) == FIELD_ARRAY) : 0;
 }

 sub IsEncryptedFlag {

There's probably smarter ways with more knowledge of the data structures in play.

Public