The string.encode('bz2') does not work in python3. Implement
passx_encode/passx_decode functions compatible with python 2.6, 2.7 and
3.3.
Add a simple unit test.
this is left-over from 87d354e1a0
Addressing:
Traceback (most recent call last):
File "/usr/bin/osc", line 26, in <module>
r = babysitter.run(osccli)
File "/usr/lib/python2.7/site-packages/osc/babysitter.py", line 60, in run
return prg.main()
File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 335, in main
self.postoptparse()
File "/usr/lib/python2.7/site-packages/osc/commandline.py", line 136, in postoptparse
override_verbose = self.options.verbose)
File "/usr/lib/python2.7/site-packages/osc/conf.py", line 873, in get_config
add_section(conffile, url, user, passwordx)
File "/usr/lib/python2.7/site-packages/osc/conf.py", line 712, in add_section
except OscConfigParser.ConfigParser.DuplicateSectionError:
AttributeError: class OscConfigParser has no attribute 'ConfigParser'
If http_debug is set we redirect sys.stdout to an StringIO
instance in order to do some header filtering (see conf module)
so we have to use the "original" stdout for printing the certificate
information.
The most visible change in python3 - removal of print statement and all
the crufty
print >> sys.stderr, foo,
The from __future__ import print_function makes it available in python
2.6
Some modules (httplib, StringIO, ...) were renamed in python3. This
patch try to import the proper symbols from python3 and then fallback to
python2 in a case ImportError will appear.
There is one exception, python 2.7 got the io module with StringIO, but
it allow unicode arguments only. Therefor the old module is poked before
new one.
This is more useful and meaningful error message than M2Crypto's
"ValueError: cafile and capath can not both be None." when neither
of cafile and capath is defined for load_verify_locations call.
This way it's possible to hide requests which have a given project
as a source project when running "osc rq list project".
Original patch by darix (just a bit beautified)
Fix situation where osc has added a blank username to the keyring and
update the config parse script to do the right thing and not allow blank
usernames.
I was in a very confusing situation where my keyring ended up with two
entries:
- @api.suse.de
- philipsb@api.suse.de
And I was getting 401s because of it.
Signed-off-by: Brandon Philips <bphilips@suse.de>
There is a bug either in buildservice or in iChain which sometimes
truncates data and sends empty Content-Length header (see bnc#656281).
This patch makes osc retry request to workaround this problem.
The number of retries are configurable in config file as http_retries.
the old code didn't turn off the ssl checking if conf['apiurl']
was configured with "sslcertk = 1".
Example:
~/.oscrc:
[https://foo]
sslcertk = 0
...
[https://main]
sslcertk = 1
...
[general]
apiurl = https://main
if you send a request to https://foo (and conf['apiurl'] == https://main)
it'll fail because the ssl checking isn't disabled.
* We may remove direct gnome keyring support later (there are currently
reports of users who can't access obs anymore when not using gnome)
* do not write passwords to .oscrc if keyring is available and used
- expanded several tabs to spaces.
- added default project to new getpac and bco subcommand. .oscrc:getpac_default_project = OpenSUSE:Factory
(not added to branch subcommand, to not interfere with its syntax.)
0.121.jw02
- made rresults an alias for results. python decorators are a strange concept...
- asserting that ~/.oscrc remains mode 0600
- no more plain text passwords in ~/.oscrc, we store now as bz2+base64
- added verbosity control -v -q. To be used in guess_proj_pack()
- added 'll' and 'ls -l' as shorthand to 'list -v'
- started to change to explicit dual license GPLv2 or GPLv3 to conform to Novell policy.
- added revision parameter to show_upstream_srcmd5(), so that it can be used in do_cat later.
- allowed both integer and srcmd5 revisions in meta_get_filelist()
- added 'lL', 'LL': allowed -e and -v together in do_list(). Was an internal error before.
- added cat -e, to cat a file through a link.
'cat -e -r 3' expands through the third revision of the _link.
- added subcmd bco as alias for branch -c
- added default project to branch subcommand. .oscrc:branch_project = OpenSUSE:Factory
- added primitive experimental support for .oscrc:checkout_no_colon = 1
- suggest using svn when .svn found.
- alias submitpac submitrequest
- osc bco now continues to checkout after branch target exists error.
- added .oscrc:plaintext_passwd=1 for backwards compatibility
- moved core.py:exclude_stuff to .oscrc:exclude_glob and expand it to catch *.orig etc.
- allowed req as alias for request.
- bugfix get_request_list: use 'or' with multiple states, not 'and'.
- added osc req list -s all; a shorthand for enumerating all states
- osc req list no longer confuses creator with approver.
- osc req list -D nnn limit to requests nnn days old.
- osc req list now also shows requests from the the given package, not only to.
- improved help texts with repairlink to point to osc resolved.
- improved passx code when creating oscrc.
- osc sr -l is now a shortcut for 'osc req list -M -a -t submit -D 0'
* obsolete deletepac and deleteprj to delete and rdelete commands.
- enable package tracking by default
* add support to hide commands in help list (so we can show propper
help when people still try to use it).
seife: this is for you, drop your own scripts emulating it :)
fostering open source contributions says that it can discourage contribution by
conveying a false sense of "code ownership". Marking territory is negatively
affecting collaboration. See http://www.youtube.com/watch?v=ZSFDm3UYkeE
* basically get rid of the scheme and apisrv mess - instead directly use the apiurl (== <protocol>://<host>) for everything
* some other minor cleanups here and there
* everyone who has a scheme or apisrv entry in his ~/.oscrc will get a deprecation warning but it's still working (at some point in the future we might remove these code paths)
* when writing a new ~/.oscrc store the apiurl in the conffile [fixes#478054]
- while being at it:
* fixed#478054 ("osc asks for build.o.o credential even if -A<somelocalapi> is always used")
* fixed#478052 ("osc backtrace on password entry (first startup)")