I have these sitting in my inbox.  I'll also try to get around to looking at 
them this weekend.

/aron

-----Original Message-----
Message: 1
Date: Thu, 10 May 2012 23:06:55 +0100
From: Steven Hardy <sha...@redhat.com>
To: J?rg Steffens <joerg.steff...@dass-it.de>
Cc: spacewalk-devel@redhat.com
Subject: Re: [Spacewalk-devel] RFE: spacecmd: patches for printing
        function results and performing diff on some spacewalk components
Message-ID: <20120510220654.ga11...@s01.fab.redhat.com>
Content-Type: text/plain; charset=iso-8859-1

On Thu, May 10, 2012 at 10:42:36PM +0200, J?rg Steffens wrote:
> Hello,
> 
> I've created some extensions for spacecmd to provide a way to handle
> different stages like
> - - development
> - - staging
> - - production
> 
> This is done by following functions:
> def do_stage_create_skel
> def do_stage_softwarechannel_diff
> def do_stage_softwarechannel_sync
> def do_stage_configchannel_diff
> def do_stage_configchannel_sync
> def do_stage_kickstart_diff
> def do_stage_activationkey_diff
> def do_stage_status
> def do_stage_dump
> 
> As my initial approach
> (https://bugzilla.redhat.com/show_bug.cgi?id=781883) did not make it
> into spacecmd,
> so now I'm now trying to add parts of the functionality as smaller
> patches.

Thanks for the patches - as I reviewed your original patch, I'm happy to review 
these (unless Aron wants to...) - I'll try to take a look tomorrow.

> First, I've a question about ret
> Most of my changes are none intrusive, however there is a behavior of
> spacecmd I'd like to change:
> currently, the do-functions normally have no return values at all.
> Because some of these functions are used by other function, a lot of
> them have an additional parameter "doreturn = False". If this is set to
> true, the result is not printed to stdout, but instead return as list of
> strings.
> 
> As a results, some code inside the do-functions is duplicated.
> Because the new functionality I've created uses some functions that
> currently do not provide a way to return there results, I'd like to
> suggest following approach:
> instead of doing this differentiation inside each function, the
> functions should always return there result as list of strings. If
> printing is required, meaning, the function is not called from outside
> and not from another function, the printing is done by shell.py:postcmd,
> which will be called after all commands called from command line.
> 
> If a function return a list of string, these will be printed to stdout.
> If not, it behaves like before. There is no immediate need to change the
> existing function, but of course, this would make the code cleaner.

I suspect this will be quite tricky to do without breaking lots of stuff, for 
example what happens to interactive operation in your new scheme?

Steve



------------------------------

Message: 2
Date: Fri, 11 May 2012 09:25:55 +0200
From: J?rg Steffens <joerg.steff...@dass-it.de>
To: Steven Hardy <sha...@redhat.com>
Cc: spacewalk-devel@redhat.com
Subject: Re: [Spacewalk-devel] RFE: spacecmd: patches for printing
        function results and performing diff on some spacewalk components
Message-ID: <4facbf03.1080...@dass-it.de>
Content-Type: text/plain; charset=ISO-8859-1

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 11.05.2012 00:06, schrieb Steven Hardy:
[...]
>> First, I've a question about ret Most of my changes are none 
>> intrusive, however there is a behavior of spacecmd I'd like to 
>> change: currently, the do-functions normally have no return
>> values at all. Because some of these functions are used by other
>> function, a lot of them have an additional parameter "doreturn =
>> False". If this is set to true, the result is not printed to
>> stdout, but instead return as list of strings.
>> 
>> As a results, some code inside the do-functions is duplicated. 
>> Because the new functionality I've created uses some functions 
>> that currently do not provide a way to return there results, I'd 
>> like to suggest following approach: instead of doing this 
>> differentiation inside each function, the functions should
>> always return there result as list of strings. If printing is
>> required, meaning, the function is not called from outside and
>> not from another function, the printing is done by
>> shell.py:postcmd, which will be called after all commands called
>> from command line.
>> 
>> If a function return a list of string, these will be printed to 
>> stdout. If not, it behaves like before. There is no immediate
>> need to change the existing function, but of course, this would
>> make the code cleaner.
> 
> I suspect this will be quite tricky to do without breaking lots of 
> stuff, for example what happens to interactive operation in your
> new scheme?

I'm not sure, what you mean be this. Normal interactive operation will
work.

J?rg

- -- 
  J?rg Steffens            joerg.steff...@dass-it.de
  dass IT GmbH             Phone: +49.221.3565666-91
  http://www.dass-IT.de      Fax: +49.221.3565666-10

 Sitz der Gesellschaft: K?ln | Amtsgericht K?ln: HRB52500
 Gesch?ftsf?hrer: S. D?hr, M. Au?endorf, J?rg Steffens, P. Storz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+svwMACgkQebMQ0f2L2xv8DwCgp0NwRoiaAN3eMQ6cHFRY3TUs
b7kAmwXFReQ48rCrmO95Zir/LPJIZSY2
=Z8XW
-----END PGP SIGNATURE-----



------------------------------

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

End of Spacewalk-devel Digest, Vol 48, Issue 5
**********************************************

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to