Bug 1339272 - A deprecation messages in ksvalidator
Summary: A deprecation messages in ksvalidator
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: pykickstart
Version: 24
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Chris Lumens
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-24 14:17 UTC by Dietrich
Modified: 2016-05-28 03:31 UTC (History)
4 users (show)

Fixed In Version: pykickstart-2.25-4.fc24
Clone Of:
Environment:
Last Closed: 2016-05-28 03:31:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Log of a run that spawns deprecation warnings (14.77 KB, text/plain)
2016-05-24 14:17 UTC, Dietrich
no flags Details
Call of ksvalidator with new pykickstart (15.56 KB, text/plain)
2016-05-26 13:56 UTC, Dietrich
no flags Details
kickstrart file used (3.22 KB, text/plain)
2016-05-26 15:50 UTC, Dietrich
no flags Details

Description Dietrich 2016-05-24 14:17:40 UTC
Created attachment 1161061 [details]
Log of a run that spawns deprecation warnings

Description of problem:

When using ksvalidator it generates a lot of deprecation messages making it unusable for actual validating. (The errors generated are cryptic and not straight forward)

Version-Release number of selected component (if applicable):
recent Fedora Package

How reproducible:
Allways

Steps to Reproduce:
1. ksvalidator ~/sample.ks -e
2. observe errors from file pykickstarterrors.log (attached)

Actual results:
Cryptic errors and deprecation warnings are mixed with actual validation errors.

Expected results:
Nice and clean display of actual errors example:

    The following problem occurred on line 21 of the kickstart file:

    no such option: --help

Additional info:
By installing most recent git (tag: r3.3-1) all of this works as expected.

Comment 1 Chris Lumens 2016-05-24 14:23:48 UTC
It'd be nice to fix this for F24.  There's a simple patch to do so (cf1da553452aa9df198253139f5d1b066dadffd0) from pykickstart-2 branch.

Comment 2 Adam Williamson 2016-05-24 20:16:26 UTC
"It'd be nice to fix this" != release blocker. We are not currently frozen for Final, so there is no Fedora process need for this to be a blocker or a freeze exception. If you need it to be a blocker or FE for anaconda team process reasons, nominating it as an FE would be more appropriate than blocker...

Comment 3 Chris Lumens 2016-05-24 20:25:52 UTC
Alright, whatever, removing the blocking part there.  When that ends up being wrong because now it's on the list for some meeting so it can be discussed how this doesn't need to be discussed, I don't want to hear about it.

Comment 4 Fedora Update System 2016-05-24 20:58:38 UTC
pykickstart-2.25-4.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-53fde35ec9

Comment 5 Fedora Update System 2016-05-26 05:02:36 UTC
pykickstart-2.25-4.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-53fde35ec9

Comment 6 Dietrich 2016-05-26 11:11:06 UTC
So the update... Is it supposed to remove the deprecation messages or just to ignore them?
Because even with the update from updates-testing I do get a horrible amount of deprecation messages.
As a User I would prefer not seeing any deprecation messages since they are not useful to me.

Thanks for the Quick update though!

Comment 7 Chris Lumens 2016-05-26 13:44:58 UTC
Please post exactly what you are running and seeing here, including the output of rpm -q pykickstart.

Comment 8 Dietrich 2016-05-26 13:56:31 UTC
Created attachment 1162008 [details]
Call of ksvalidator with new pykickstart

The complete requested info is in the attachment:

  > rpm -q pykickstart
  pykickstart-2.25-4.fc24.noarch

The messages that bug me:

    callback=csv_parse_callback, nargs=1, type="string")
/usr/lib/python3.5/site-packages/pykickstart/commands/repo.py:173: PendingDeprecationWarning: add_option is deprecated and will be removed in pykickstart-3.  Use add_argument instead.

Comment 9 Chris Lumens 2016-05-26 15:25:15 UTC
Can you also post your kickstart file?  You can remove passwords and other sensitive information.  That shouldn't affect things.

Comment 10 Dietrich 2016-05-26 15:50:56 UTC
Created attachment 1162160 [details]
kickstrart file used

Hey sure thing... I don't think that this is relevant though! As I get those messages on prettymuch everything I call ksvalidator with. Example below with an empty file. It could be a local issue if everything works for you I recheck my stuff - Its on a Computer that has been upgraded and tinkered with for quite some years now.

$ touch test.ks
$ ksvalidator test.ks
/usr/lib/python3.5/site-packages/pykickstart/version.py:59: PendingDeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp              # type: ignore
/usr/lib/python3.5/site-packages/pykickstart/commands/repo.py:173: PendingDeprecationWarning: add_option is deprecated and will be removed in pykickstart-3.  Use add_argument instead.
  op.add_option("--name", dest="name", required=1)
....

Comment 11 Chris Lumens 2016-05-26 16:02:59 UTC
Huh, I feel like one of us is testing the wrong thing then.  If I touch a blank file and run ksvalidator on it, I see:

/usr/lib/python3.5/optparse.py:999: PendingDeprecationWarning: The KSOption class is deprecated and will be removed in pykickstart-3.  Use the argparse module instead.
  option = self.option_class(*args, **kwargs)
General error in input file:  stat: can't specify None for path argument

Note that I don't think I can do much about that first deprecation warning I am seeing.  It's pretty tricky to deal with.  So basically the best you can hope for with this update is that the number of deprecation warnings is really calmed down, but one or two are still going to sneak through.

Oh, what version of python3-kickstart do you have installed?  That could be what's going on.

Comment 12 Dietrich 2016-05-26 16:12:51 UTC
Ok Python3 was the Thing!

So parsing the valid file I get the following which is nicer than at first but still has some deprecation messages. I guess its acceptable though not beautiful so I give karma to the update.

and thanks for your help!

$ ksvalidator ownCloud/ks.cfg 
/usr/lib64/python3.5/optparse.py:999: PendingDeprecationWarning: The KSOption class is deprecated and will be removed in pykickstart-3.  Use the argparse module instead.
  option = self.option_class(*args, **kwargs)
_setToSelf has been renamed to set_to_self.  The old name will be removed in a future release.
_setToSelf has been renamed to set_to_self.  The old name will be removed in a future release.
_setToSelf has been renamed to set_to_self.  The old name will be removed in a future release.
_setToSelf has been renamed to set_to_self.  The old name will be removed in a future release.
_setToObj has been renamed to set_to_obj.  The old name will be removed in a future release.
_setToObj has been renamed to set_to_obj.  The old name will be removed in a future release.
_setToSelf has been renamed to set_to_self.  The old name will be removed in a future release.
add_option is deprecated and will be removed in pykickstart-3.  Use add_argument instead.
add_option is deprecated and will be removed in pykickstart-3.  Use add_argument instead.

Comment 13 Chris Lumens 2016-05-26 17:30:46 UTC
That's still not very clean.

(1) _setToSelf and _setToObj is an oversight.  I could fix that up both on pykickstart-2 branch and also here, if it's annoying.

(2) I wonder if I need to do something in the spec file to make sure the two packages get updated at the same time, so others don't hit this problem.

Comment 14 Fedora Update System 2016-05-28 03:31:47 UTC
pykickstart-2.25-4.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.