1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-21 17:56:19 +02:00
Commit Graph

3371 Commits

Author SHA1 Message Date
lethliel
eb3a3ef0ec Introduction of new credential management
* new module credentials.py which contains classes
  and methods to set and get passwords for different
  backends:
      - python-keyring
      - gnomekeyring
      - ConfigFile based storage

The new code should be backward compatible except a minor
change in add_section (pass and passx are not removed from
the config parser). This affects only callers that do not pass
a creds_mgr_descriptor.

On initial osc call or initial osc call on new API Url
the user now can decide where to store the password (based
on the backends available on his system)
2019-08-29 15:04:36 +02:00
lethliel
c9d85ac248 move raw_input function to helper module 2019-08-27 15:17:53 +02:00
Marcus Huewe
7c01399a4a Deprecate the "plaintext_passwd" config option
The upcoming credentials manager abstraction supersedes the old
plaintext_passwd behavior. This commits "breaks" the old behavior:
Passwords are not rewritten anymore (plaintext <-> obfuscated)
2019-08-27 15:15:59 +02:00
lethliel
428a81e451 Refactor config setup dialog
Move logic to conf module in new function interactive_config_setup
for new config file and missing apiurl section.

Dropped keyring code, because it was never used in write_initial_config()
2019-08-26 17:25:56 +02:00
lethliel
dbed74a13f reopen 0.166 development 2019-08-05 08:47:46 +02:00
lethliel
5994326451 release 0.165.4 2019-08-05 08:45:32 +02:00
Marcus Huewe
63c103770a Merge branch 'fix_600_osc-h_not_working_with_plugins' of https://github.com/lethliel/osc
python3 "workaround" for the quite fragile code in
RawCmdln._help_preprocess: It depends on the "non-deterministic" order
of preprocessor.items(). Hence, the results may differ on python2 and
python3. The real fix is probably to enforce a fixed iteration order.
See also the discussion in [1].

[1] https://github.com/openSUSE/osc/pull/604
2019-08-03 16:20:01 +02:00
lethliel
c78c8178e6 prevent plugins to break help
prevent call of preprocessor if ${cmd_name} marker is accidentaly set,
but cmdname is None.

Also for cmd_option_list and cmd_usage
overwrite _help_preprocess_* functions in Osc class
2019-08-02 20:02:14 +02:00
Marcus Huewe
6e95f8019d Merge branch 'fix_#607' of https://github.com/lethliel/osc
Do not apply the --target-package-filter pattern if there is no target
package.
2019-08-02 13:31:53 +02:00
Marcus Huewe
181bfe8c75 Merge branch 'master' of https://github.com/andreas-schwab/osc
Use the correct appname for the trusted-certs store.
Follow-up fix for commit 9daa15de8e
("Merge branch 'fix_CVE-2013-3685' of https://github.com/lethliel/osc").
2019-07-28 20:04:18 +02:00
Andreas Schwab
c9d320bf92 Use correct appname for trusted-certs store 2019-07-28 14:59:14 +02:00
Marcus Huewe
e5c4a10673 Merge branch 'dont_decode_None' of https://github.com/lethliel/osc
Do not try to decode None in decode_it (in this case None is returned).
2019-07-26 14:35:03 +02:00
lethliel
a802df15ad return the obj if None type is passed to decode_it
If a obj of type None is passed to decode_it just
return it and do not try to decode it as this will fail
2019-07-26 14:22:26 +02:00
Marcus Huewe
1b6149fc75 Merge branch 'fix_local_package_cache_for_all_formats' of https://github.com/lethliel/osc
Make osc.util.{debquery,rpmquery} a bytes only api again.
2019-07-26 14:01:59 +02:00
lethliel
2aa6e998d2 fix and unify building of local package cache
* all filename functions now return bytes-like objects
* the caller does the decoding
* the caller in build.py passes encoded arguments
2019-07-26 13:38:45 +02:00
Marco Strigl
5c75566d22
Merge pull request #606 from adrianschroeter/maint_enforce_branch
allow implicit branch on maintenance request creation
2019-07-25 13:46:58 +02:00
Marco Strigl
d2de7ccc97
Merge branch 'master' into maint_enforce_branch 2019-07-25 13:46:18 +02:00
f465717668 allow implicit branch on maintenance request creation
via --enforce-branching option

This may be default by server side settings
2019-07-25 13:43:45 +02:00
Marcus Huewe
a98943cfc3 Merge branch 'rpmerror_fix' of https://github.com/mgerstner/osc
Make sure that RPMError is always a real "exception".
2019-07-25 12:40:30 +02:00
Matthias Gerstner
0a99f35126
babysitter: fix RPMError fallback when running in Python3
After (successfully) running an 'osc vc' the following exception trace
comes up, when no rpm python module is available:

```
no changes made
Traceback (most recent call last):
  File "/home/mgerstner/.local/lib64/python3.6/site-packages/osc/babysitter.py", line 62, in run
    return prg.main(argv)
  File "/home/mgerstner/.local/lib64/python3.6/site-packages/osc/cmdln.py", line 344, in main
    return self.cmd(args)
  File "/home/mgerstner/.local/lib64/python3.6/site-packages/osc/cmdln.py", line 367, in cmd
    retval = self.onecmd(argv)
  File "/home/mgerstner/.local/lib64/python3.6/site-packages/osc/cmdln.py", line 501, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/home/mgerstner/.local/lib64/python3.6/site-packages/osc/cmdln.py", line 1232, in _dispatch_cmd
    return handler(argv[0], opts, *args)
  File "/home/mgerstner/.local/lib64/python3.6/site-packages/osc/commandline.py", line 8924, in do_vc
    sys.exit(vc.returncode)
SystemExit: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mgerstner/bin/osc", line 41, in <module>
    r = babysitter.run(osccli)
  File "/home/mgerstner/.local/lib64/python3.6/site-packages/osc/babysitter.py", line 172, in run
    except RPMError as e:
TypeError: catching classes that do not inherit from BaseException is not allowed
```

To fix this change the fallback RPMError from None to an actual
Exception-derived type.
2019-07-25 10:58:56 +02:00
lethliel
5e39cdf683 open 0.166 development 2019-07-24 15:15:45 +02:00
lethliel
26214f7dcd release 0.165.3 2019-07-24 15:13:39 +02:00
Marcus Huewe
71ae93b35a Merge branch 'switch_diffs_to_bytes' of https://github.com/lethliel/osc
Since we do not know the files' encoding, the diff functions/methods
have to return bytes. Note: decoding the diff result is wrong in
general (see the discussion in [1]).

[1] https://github.com/openSUSE/osc/pull/554
2019-07-24 14:45:23 +02:00
lethliel
2b47be6b1e switch to difflib.diff_bytes in python3 case.
The files are now opened as rb for diffing. In python2 nothing changes.
In python3 the returned diff is bytes now.

The following changes were made:
  * commandline.py: The returned diff is now bytes
  * get_diff now returs the diff as a bytes-like object
  * run_pager writes with sys.stdout.buffer.write if message
    is not a string
  * for the commit message the returned diff needs to be decoded
    now. Otherwise it will just producce garbage. For the commit
    message the diff on decoded bytes-objects is ok. (nothing harmfull
    can happen here)
  * fixed submit_action_diff
  * fixed request_interactive_review
2019-07-24 13:48:39 +02:00
Marco Strigl
714dca0c92
Merge pull request #610 from lethliel/master
updated NEWS
2019-07-24 08:46:22 +02:00
lethliel
837a63e9d6 updated NEWS 2019-07-24 08:25:44 +02:00
Marcus Huewe
9daa15de8e Merge branch 'fix_CVE-2013-3685' of https://github.com/lethliel/osc
Use custom https connection classes. Follow-up fix for commit
6ddf771c9f ("[python3] make oscssl.py
python3 ready.").
2019-07-23 20:53:37 +02:00
lethliel
1d866351b9 fix oscssl.py not verifying TLS cert verification
use own implementation of HTTPSConnection (myHTTPSConnection)
instead the one provided by M2Crypto (httpslib.HTTPConnection)
And in proxy case use myProxyHTTPSConnection.

all credits go to wfrisch
2019-07-23 19:42:51 +02:00
lethliel
0c0dca0b27 Fix package filtering for osc rq
Check if action.tgt_package is None.
2019-07-23 15:51:41 +02:00
Marcus Huewe
23c8f19868 Merge branch 'fix_issue_602_osc_api' of https://github.com/lethliel/osc
Do not decode the api result in do_api.
2019-07-19 12:56:44 +02:00
lethliel
cc44dded85 Do not decode output from osc api calls
Do not guess the decoding of the returned output on osc api calls.
This could lead to unexptected behavior. Just use sys.stdout.buffer.write()
to print the bytes-like object in python3.
2019-07-19 08:44:57 +02:00
Marcus Huewe
107976e8f8 Merge branch 'remove_old_version_from_travis' of https://github.com/lethliel/osc
Old python3 versions do not support %-interpolation with bytes.
2019-07-17 14:26:36 +02:00
lethliel
43274ae06a remove python 3.3 and 3.4 from testing
Those versions are not supported anymore and thus testing
is not needed anymore.
2019-07-17 11:35:10 +02:00
Marcus Huewe
ba0f07db6a Merge branch 'fix_osc_ls_l_empty_size_but_not_empyt_mtime' of https://github.com/lethliel/osc
Do not fail in do_list if f.size or f.mtime is None.
2019-07-13 16:45:27 +02:00
lethliel
49b0325ab0 fix error when f.size is None but f.mtime is not
The if statement just catches the case when both (f.size
and f.mtime) are None.

Added two elifs to catch the cases that just one of them is None.
2019-07-11 13:43:22 +02:00
lethliel
9a1b2d980a open 0.165.3 development 2019-07-08 11:30:42 +02:00
lethliel
d17b46c948 release 0.165.2 2019-07-08 11:28:50 +02:00
Marco Strigl
9dfc6c211e
Merge pull request #592 from lethliel/fix_empty_prjconf_meta
fix handling of empty prjconfig meta
2019-07-02 13:53:51 +02:00
lethliel
ef4b0ce023 fix handling of empty prjconfig meta
if prjconfig meta is empty the class metafile init
fails with

if isinstance(input[0], str):
IndexError: list index out of range

This is because input is an empty list and has no
[0] index.

This can be fixed by changing this line to:

if input and isinstance(input[0], str):
2019-07-02 09:36:05 +02:00
Marco Strigl
d516560d47
Merge pull request #591 from adrianschroeter/simpleimage
fix typo in last commit fixing simpleimage support
2019-06-27 16:47:14 +02:00
72b96b7d39 fix typo in last commit fixing simpleimage support 2019-06-27 16:34:41 +02:00
Marco Strigl
704c495dca
Merge pull request #590 from adrianschroeter/simpleimage
fix local build using simpleimage
2019-06-27 16:20:43 +02:00
024759bee0 fix local build using simpleimage 2019-06-27 16:14:17 +02:00
Marco Strigl
fe50d08df7
Merge pull request #587 from lethliel/fix_lbl_with_non_utf8_encoding
[python3] fix osc lbl non utf8 encoding
2019-06-21 10:47:57 +02:00
lethliel
682452d914 [python3] fix osc lbl non utf8 encoding
data can contain non-utf8 chars. So passing data to
the decode_it function will solve this problem.
2019-06-21 10:13:31 +02:00
Marco Strigl
7df178b50b
Merge pull request #552 from lethliel/fix_unhandled_exception_on_empty_package
fix triggerreason on empty packages.
2019-06-12 13:07:16 +02:00
Marcus Huewe
6362887977 Merge branch 'fix_osc_lock' of https://github.com/lethliel/osc
The "input" parameter of the metafile's __init__ method can be a bytes
now. (Also, fixes one bug + introduces a new one (old code could break
on an empty bytes b'' and the new code could break on an empty list
(however, the current osc code shouldn't pass such arguments)).)
2019-06-12 11:16:44 +02:00
lethliel
2568f88438 simplified class metafile __init__ method
simplified and fixed the __init__ method of the metafile class.
input can be string, bytes-like object, list of strings or list
of bytes-like objects now.

Based on the input now always a list is generated and joined to
a string for writing in the fd. (This is ugly but needed for
compat reasons)
2019-06-11 15:08:52 +02:00
Marco Strigl
9a098c4af8
Merge pull request #578 from lethliel/python3_fix_set_bugowner
[python3] osc maintainer -s now works with python3
2019-06-11 12:53:20 +02:00
lethliel
d85c901f88 osc maintainer -s now works with python3
data is a bytes-like object now and needs to be joined into a
bytes-like object.
2019-06-11 12:00:42 +02:00