Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--cli-config only works in test mode #1299

Closed
cperezpenichet opened this issue Jul 28, 2016 · 9 comments · Fixed by #1300
Closed

--cli-config only works in test mode #1299

cperezpenichet opened this issue Jul 28, 2016 · 9 comments · Fixed by #1300
Assignees
Labels

Comments

@cperezpenichet
Copy link

Expected behaviour:

Passing configuration parameters to flexget execute from the command line with --cli-config should work in normal (non-test) mode. The values passed through the command line should be replaced in the configuration variables the same way the are in test mode.

Actual behaviour:

It works as expected as long as the --test flag is used. Without the --test flag variables in the configuration are not replaced by the values passed with --cli-config, instead, the literal variable name is used, i.e. $variable.

Steps to reproduce:

  • Step 1: Using the minimal configuration below.
  • Step 2: To observe correct behaviour execute in test mode:

flexget --test execute --tasks test --cli-config variable=foobar -v --dump

  • Step 3: To observe incorrect behaviour execute in normal mode:

flexget execute --tasks test --cli-config variable=foobar -v --dump

Config:

tasks:
  test:
    mock:
      - title: $variable

Log:

Test mode log:

The output is as expected. See how $variable is evaluated to 'foobar' in the entry title:

2016-07-28 10:27 INFO     manager                       Test mode, creating a copy from database ...
2016-07-28 10:27 INFO     manager                       Test database created
2016-07-28 10:27 VERBOSE  task_queue                    There are 1 tasks to execute. Shutdown will commence when they have completed.
2016-07-28 10:27 VERBOSE  details       test            Produced 1 entries.
2016-07-28 10:27 WARNING  task          test            Task does not have any filter plugins to accept entries. You need at least one to accept the entries you  want.
2016-07-28 10:27 VERBOSE  details       test            Summary - Accepted: 0 (Rejected: 0 Undecided: 1 Failed: 0)
2016-07-28 10:27 WARNING  task          test            Task doesn't have any output plugins, you should add (at least) one!
-- Undecided: --------------------------
title            : foobar
url              : mock://localhost/mock/3433925302934160649
original_url     : mock://localhost/mock/3433925302934160649
quality          : <LazyField - value will be determined when it is accessed>
task             : test

2016-07-28 10:27 VERBOSE  verbose       test            UNDECIDED: `foobar`
2016-07-28 10:27 VERBOSE  verbose       test            Undecided entries have not been accepted or rejected. If you expected these to reach output, you must set up filter plugin(s) to accept them.
2016-07-28 10:27 INFO     manager                       Removed test database
Normal mode log:

Incorrect behaviour. $variable is not evaluated in the entry title:

There is a FlexGet process already running for this config, sending execution there.
2016-07-28 10:32 VERBOSE  details       test            Produced 1 entries.
2016-07-28 10:32 WARNING  task          test            Task does not have any filter plugins to accept entries. You need at least one to accept the entries you  want.
2016-07-28 10:32 VERBOSE  details       test            Summary - Accepted: 0 (Rejected: 0 Undecided: 1 Failed: 0)
2016-07-28 10:32 WARNING  task          test            Task doesn't have any output plugins, you should add (at least) one!
-- Undecided: --------------------------
title            : $variable
url              : mock://localhost/mock/3088942986836962869
original_url     : mock://localhost/mock/3088942986836962869
quality          : <LazyField - value will be determined when it is accessed>
task             : test

2016-07-28 10:32 VERBOSE  verbose       test            UNDECIDED: `$variable`
2016-07-28 10:32 VERBOSE  verbose       test            Undecided entries have not been accepted or rejected. If you expected these to reach output, you must set up filter plugin(s) to accept them.

Additional information:

  • Flexget Version: 2.2.0
  • Python Version: 2.7.6
  • Installation method: pip
  • OS and version: Ubuntu 14.04.4
@liiight
Copy link
Member

liiight commented Jul 28, 2016

hmm, i think this has more to do than daemon running than test mode. can you try without daemon running?

@cperezpenichet
Copy link
Author

Yes, I confirm that it works as expected WITHOUT the daemon running. Is there any way around this?

@liiight
Copy link
Member

liiight commented Jul 28, 2016

It is a bug, just not related to test mode. It should invoke config reload when used, I'll try to fix soon.

@liiight liiight added the Bug label Jul 28, 2016
@liiight liiight self-assigned this Jul 28, 2016
@cperezpenichet
Copy link
Author

Thanks a lot I would appreciate it! I could also try to give it a try myself but I am not familiar with the code. ...perhaps with some guidance I could manage it.

@cperezpenichet
Copy link
Author

Great!

Thanks, it seems to be working now.

@liiight
Copy link
Member

liiight commented Jul 28, 2016

You know I haven't done anything yet, right? Also, what exactly are you using this for?

@cperezpenichet
Copy link
Author

I just tried those two lines you changed. Even if hacky, it works.

I am trying to do something similar to this: http://flexget.com/Cookbook/CLISearch

@liiight
Copy link
Member

liiight commented Jul 31, 2016

Yeah, it'll work but not very polished yet. Shouldn't cause any harmful side effects thought.

Also, as a rule of thumb, any time you want to pass a value to the input of a task, you could use the inject option imo

liiight added a commit that referenced this issue Sep 16, 2016
Allow config changing plugins to operate while daemon is running. Fixes #1299
liiight added a commit that referenced this issue Sep 27, 2016
@liiight liiight reopened this Sep 27, 2016
@liiight
Copy link
Member

liiight commented Sep 27, 2016

I reverted the fix for this as it was causing issues. The real fix to this need to be a new way to pass options to daemon without any hacks, and honestly that seems like too much work just to get this plugin to work in daemon mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants