Searchables for Foreman Async Task commands

I am not putting this into a PR, since I am not sure it is correct. I
noticed that async commands do not get the id to name expansion done. I
think this is because there are no searchables added. I noticed this
testing

bundle exec bin/hammer -v -u admin -p changeme subscription upload --help

with katello plugins installed.

Is the expection that (1) the individual commands actually add the
searchables? Or, should a patch like the one attached be applied?

Thanks!

– bk

searchables.patch (906 Bytes)

I believe correct solution is:

https://github.com/theforeman/hammer-cli-foreman-tasks/pull/9
https://github.com/Katello/hammer-cli-katello/pull/169

T.

··· On 05/14/2014 11:09 PM, Bryan Kearney wrote: > I am not putting this into a PR, since I am not sure it is correct. I > noticed that async commands do not get the id to name expansion done. I > think this is because there are no searchables added. I noticed this > testing > > bundle exec bin/hammer -v -u admin -p changeme subscription upload --help > > > with katello plugins installed. > > > Is the expection that (1) the individual commands actually add the > searchables? Or, should a patch like the one attached be applied? > > Thanks! > > -- bk >

Looking at these now. It lists out the expansions (see below) but I am
getting an error which is

[bkearney@bkearney hammer-cli]$ bundle exec bin/hammer -u admin -p
changeme subscription upload --organization-label DemoOrg --file
/tmp/manifest.zip --repository-url 'https://cdn.redhat.com'
Manifest upload failed:
Error: Missing options to search subscription

One thing I noticed… with this patch I see:

[bkearney@bkearney hammer-cli]$ bundle exec bin/hammer -u admin -p
changeme subscription upload --help
Usage:
hammer subscription upload [OPTIONS]

Options:
–activation-key ACTIVATION_KEY_NAME
–activation-key-id ACTIVATION_KEY_ID
–async Do not wait for the task
–file MANIFEST Subscription manifest file
–name NAME Name to search by
–organization ORGANIZATION_NAME
–organization-id ORGANIZATION_ID Organization id
–organization-label ORGANIZATION_LABEL
–repository-url REPOSITORY_URL repository url
–system SYSTEM_NAME
–system-id SYSTEM_ID
-h, --help print help

The following options have come from the index command, but are not
applicable to the upload:

activation-key
name
system

I wonder if we need to move to a model where we do the required and then
I declare the optional ones I want to use?

– bk

··· On 05/15/2014 09:51 AM, Tomas Strachota wrote: > On 05/14/2014 11:09 PM, Bryan Kearney wrote: >> I am not putting this into a PR, since I am not sure it is correct. I >> noticed that async commands do not get the id to name expansion done. I >> think this is because there are no searchables added. I noticed this >> testing >> >> bundle exec bin/hammer -v -u admin -p changeme subscription upload --help >> >> >> with katello plugins installed. >> >> >> Is the expection that (1) the individual commands actually add the >> searchables? Or, should a patch like the one attached be applied? >> >> Thanks! >> >> -- bk >> > > I believe correct solution is: > > https://github.com/theforeman/hammer-cli-foreman-tasks/pull/9 > https://github.com/Katello/hammer-cli-katello/pull/169 > > T. >

>>> I am not putting this into a PR, since I am not sure it is correct. I
>>> noticed that async commands do not get the id to name expansion done. I
>>> think this is because there are no searchables added. I noticed this
>>> testing
>>>
>>> bundle exec bin/hammer -v -u admin -p changeme subscription upload
>>> --help
>>>
>>>
>>> with katello plugins installed.
>>>
>>>
>>> Is the expection that (1) the individual commands actually add the
>>> searchables? Or, should a patch like the one attached be applied?
>>>
>>> Thanks!
>>>
>>> – bk
>>>
>>
>> I believe correct solution is:
>>
>> https://github.com/theforeman/hammer-cli-foreman-tasks/pull/9
>> https://github.com/Katello/hammer-cli-katello/pull/169
>>
>> T.
>>
> Looking at these now. It lists out the expansions (see below) but I am
> getting an error which is
>
> [bkearney@bkearney hammer-cli]$ bundle exec bin/hammer -u admin -p
> changeme subscription upload --organization-label DemoOrg --file
> /tmp/manifest.zip --repository-url 'https://cdn.redhat.com'
> Manifest upload failed:
> Error: Missing options to search subscription
>
> One thing I noticed… with this patch I see:
>
> [bkearney@bkearney hammer-cli]$ bundle exec bin/hammer -u admin -p
> changeme subscription upload --help
> Usage:
> hammer subscription upload [OPTIONS]
>
> Options:
> --activation-key ACTIVATION_KEY_NAME
> --activation-key-id ACTIVATION_KEY_ID
> --async Do not wait for the task
> --file MANIFEST Subscription manifest file
> --name NAME Name to search by
> --organization ORGANIZATION_NAME
> --organization-id ORGANIZATION_ID Organization id
> --organization-label ORGANIZATION_LABEL
> --repository-url REPOSITORY_URL repository url
> --system SYSTEM_NAME
> --system-id SYSTEM_ID
> -h, --help print help
>
>
> The following options have come from the index command, but are not
> applicable to the upload:
>
> activation-key
> name
> system
>
> I wonder if we need to move to a model where we do the required and then
> I declare the optional ones I want to use?

I updated the PR but I didn't help it at all.

Last time I promised to implement manual backup if the attempt fails:)
So, I think we should go for it. It's better not to get blocked and have
some means to tune the commands up when the automatic methods fail.

Would you mind creating an issue for that?

T.

··· On 05/15/2014 04:40 PM, Bryan Kearney wrote: > On 05/15/2014 09:51 AM, Tomas Strachota wrote: >> On 05/14/2014 11:09 PM, Bryan Kearney wrote:

– bk

http://projects.theforeman.org/issues/5747

if you could please bump this up the priority list, I would appreciate it!

– bk

··· On 05/15/2014 01:10 PM, Tomas Strachota wrote: > I updated the PR but I didn't help it at all. > > Last time I promised to implement manual backup if the attempt fails:) > So, I think we should go for it. It's better not to get blocked and have > some means to tune the commands up when the automatic methods fail. > > Would you mind creating an issue for that? > > T.

> > I updated the PR but I didn't help it at all.
> >
> > Last time I promised to implement manual backup if the attempt fails:)
> > So, I think we should go for it. It's better not to get blocked and have
> > some means to tune the commands up when the automatic methods fail.
> >
> > Would you mind creating an issue for that?
> >
> > T.
> Bug #5747: [RFE] Fine grained control over name expansion - Hammer CLI - Foreman
>
> if you could please bump this up the priority list, I would appreciate it!
>
> – bk

tomas, i commented on that redmine issue with some suggestions on how it could be used by a developer. let me know what you think.

thanks

··· ----- Original Message ----- > On 05/15/2014 01:10 PM, Tomas Strachota wrote:


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