On Wed 09 Apr 2008 at 09:47PM, Danek Duvall wrote:
>     http://cr.opensolaris.org/~dduvall/pkg-bug821/

132: Is a \n needed here before the contents of stdout?  It could
be more than one line of output.

61-68: I had assumed that Popen's stdin default is /dev/null?  It's
not clear from the documentation (it says it's "None" but that
doesn't mean much).

Callers of __call-- perhaps you could commonize all of this
code into __call()?

 285  301        args = add_base + ("-p", i, self.attrs["name"])
 286      -      retcode = subprocess.call(args)
      302 +      retcode, stdout = self.__call(args)
 287  303        if retcode != 0:
 288  304                print "%s (%s) upgrade (addition of policy " \
 289  305                    "'%s') failed with return code %s" % \
 290  306                    (self.name, self.attrs["name"], i, retcode)
 291  307                print "command run was ", args
      308 +              print "command output was", stdout.read()

Becomes:

        self.__call(fail="%s (%s) upgrade (addition of policy " \
            "'%s') failed." % (self.name, self.attrs["name"], i)

Then call can do the common work of printing the error message,
the return code, the command run, and the output.

Could be an RFE for later.

        -dp

-- 
Daniel Price - Solaris Kernel Engineering - [EMAIL PROTECTED] - blogs.sun.com/dp
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to