Lifecycle environment and puppet environment CLI naming conflict

Hi all,
I discovered integration issue in the katello CLI plugin [1] today.

Value of parameter --environment in all katello commands is treated as
if it was puppet environment. ID resolver matches the option against the
environment resource from foreman.

There are 2 ways of solving the problem:

#1 Tweak id resolver for katello commands to always use
lifecycle-environments whenever it is asked for env id. Something like [2].
It's a simple 3-line solution but closes the possibility of referencing
puppet envs from katello commands.

#2 Rename environment_id parameters in katello API to
lifecycle_environment_id so that the id resolver matches correct resource.
Options would then get expanded to
–lifecycle-environment
–lifecycle-environment-id
–lifecycle-environment-label
which is a bit longish.
On the other hand it's a systematic solution that avoids user confusion
from the option names.

Preferences?

Regards
Tomas

[1] Bug #5876: Lifecycle environments and puppet environments conflict in id resolution - Katello - Foreman
[2]
https://gist.github.com/tstrachota/971cfecc7975d94f0c7c#file-katello_id_resolver-rb-L3-L5

> Hi all,
> I discovered integration issue in the katello CLI plugin [1] today.
>
> Value of parameter --environment in all katello commands is treated as
> if it was puppet environment. ID resolver matches the option against the
> environment resource from foreman.
>
> There are 2 ways of solving the problem:
>
> #1 Tweak id resolver for katello commands to always use
> lifecycle-environments whenever it is asked for env id. Something like [2].
> It's a simple 3-line solution but closes the possibility of referencing
> puppet envs from katello commands.
>
> #2 Rename environment_id parameters in katello API to
> lifecycle_environment_id so that the id resolver matches correct resource.
> Options would then get expanded to
> --lifecycle-environment
> --lifecycle-environment-id
> --lifecycle-environment-label
> which is a bit longish.
> On the other hand it's a systematic solution that avoids user confusion
> from the option names.

+1 on the second one

ideally, also the foreman's current environment would be worth
renaming to puppet-environment (as that's what it is), sooner or later,
it will bite back again (for example with other config management tools coming in play)

– Ivan

··· ----- Original Message -----

Preferences?

Regards
Tomas

[1] Bug #5876: Lifecycle environments and puppet environments conflict in id resolution - Katello - Foreman
[2]
https://gist.github.com/tstrachota/971cfecc7975d94f0c7c#file-katello_id_resolver-rb-L3-L5


You received this message because you are subscribed to the Google Groups
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

#2

··· ----- Original Message ----- > Hi all, > I discovered integration issue in the katello CLI plugin [1] today. > > Value of parameter --environment in all katello commands is treated as > if it was puppet environment. ID resolver matches the option against the > environment resource from foreman. > > There are 2 ways of solving the problem: > > #1 Tweak id resolver for katello commands to always use > lifecycle-environments whenever it is asked for env id. Something like [2]. > It's a simple 3-line solution but closes the possibility of referencing > puppet envs from katello commands. > > #2 Rename environment_id parameters in katello API to > lifecycle_environment_id so that the id resolver matches correct resource. > Options would then get expanded to > --lifecycle-environment > --lifecycle-environment-id > --lifecycle-environment-label > which is a bit longish. > On the other hand it's a systematic solution that avoids user confusion > from the option names. > > Preferences? > > Regards > Tomas > > > [1] http://projects.theforeman.org/issues/5876 > [2] > https://gist.github.com/tstrachota/971cfecc7975d94f0c7c#file-katello_id_resolver-rb-L3-L5 > > -- > You received this message because you are subscribed to the Google Groups > "foreman-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to foreman-dev+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. >

  • adam price

#2 +1

··· On 22.05.14 14:55, Tomas Strachota wrote: > Hi all, > I discovered integration issue in the katello CLI plugin [1] today. > > Value of parameter --environment in all katello commands is treated as > if it was puppet environment. ID resolver matches the option against the > environment resource from foreman. > > There are 2 ways of solving the problem: > > #1 Tweak id resolver for katello commands to always use > lifecycle-environments whenever it is asked for env id. Something like [2]. > It's a simple 3-line solution but closes the possibility of referencing > puppet envs from katello commands. > > #2 Rename environment_id parameters in katello API to > lifecycle_environment_id so that the id resolver matches correct resource. > Options would then get expanded to > --lifecycle-environment > --lifecycle-environment-id > --lifecycle-environment-label > which is a bit longish. > On the other hand it's a systematic solution that avoids user confusion > from the option names. > > Preferences? > > Regards > Tomas > > > [1] http://projects.theforeman.org/issues/5876 > [2] > https://gist.github.com/tstrachota/971cfecc7975d94f0c7c#file-katello_id_resolver-rb-L3-L5 > >

> There are 2 ways of solving the problem:

#3 Rename both lifecycle-environment and puppet-environment.

Because what happens if we add, say Chef Environment?

··· -- Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman

> > There are 2 ways of solving the problem:
>
> #3 Rename both lifecycle-environment and puppet-environment.

+1 #3

··· ----- Original Message -----

Because what happens if we add, say Chef Environment?


Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman


You received this message because you are subscribed to the Google Groups
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

>
>
>
> > > There are 2 ways of solving the problem:
> >
> > #3 Rename both lifecycle-environment and puppet-environment.
>
> +1 #3
>
> >
> > Because what happens if we add, say Chef Environment?
> >
> > –
> > Later,
> >
> > Lukas "lzap" Zapletal
> > irc: lzap #theforeman
> >
> > –
> > You received this message because you are subscribed to the Google
> Groups
> > "foreman-dev" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an
> > email to foreman-dev...@googlegroups.com <javascript:>.
> > For more options, visit https://groups.google.com/d/optout.
> >
>

>
>
>
> > > There are 2 ways of solving the problem:
> >
> > #3 Rename both lifecycle-environment and puppet-environment.
>
> +1 #3
>
> +1 #3 too.

> >
> > Because what happens if we add, say Chef Environment?
> >
> > –
> > Later,
> >
> > Lukas "lzap" Zapletal
> > irc: lzap #theforeman
> >
> > –
> > You received this message because you are subscribed to the Google
> Groups
> > "foreman-dev" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an
> > email to foreman-dev...@googlegroups.com <javascript:>.
> > For more options, visit https://groups.google.com/d/optout.
> >
>

··· On Tuesday, May 27, 2014 4:58:50 AM UTC-7, Tom McKay wrote: > ----- Original Message ----- On Tuesday, May 27, 2014 4:58:50 AM UTC-7, Tom McKay wrote: > ----- Original Message -----