1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 17:26:15 +02:00
Commit Graph

28 Commits

Author SHA1 Message Date
ca9dc30643 parseRevisionOption(): Raise an exception on invalid revisions 2022-06-02 10:01:57 +02:00
90a1cb838b Report a config error when trying to load credentials_mgr_class that does't exist 2022-03-28 09:49:55 +02:00
lethliel
cba4b58bbe Improve password handling
* Adapt do_config to use the new credentials manager implementation
  and add a --change-password option which can be used to change the
  password.
* Adapt config_set_option to follow the change in do_config.
* Split selection of the credentials manager descriptor to reuse it
  in do_config and interactive_config_setup.
* Introduce new ConfigMissingCredentialsError which is raised in case
  of missing credentials (user or password). In this case the user will
  be asked to enter the new credentials.
2019-08-29 16:11:17 +02:00
lethliel
40caf1ce0a [python3] self[i] is now self.args[i] 2018-12-13 13:27:22 +01:00
Marcus Huewe
78e0aa90f5 Fix "args" handling in class PackageNotInstalled 2016-09-09 13:14:35 +02:00
083f23f77b support new package instances on branching when using -N parameter 2015-07-21 13:03:07 +02:00
Marcus Huewe
b2b2d54312 - oscerr.ServiceRuntimeError: fixed docstr 2013-08-29 15:35:40 +02:00
c00751f4d7 - handle errors of source service runs 2011-05-24 10:49:08 +02:00
Ludwig Nussel
b33577b6a7 use more generic oscerr.PackageNotInstalled 2011-04-18 11:03:28 +02:00
Marcus Huewe
be4f1f350e - renamed "PackageNotInstalled" exception to "ServiceNotInstalled"
- also catch this exception in babysitter.py
2011-03-30 01:10:48 +02:00
7fe43cb486 - missing source serivce on local workstation is not an API error 2011-03-16 10:20:50 +01:00
Marcus Huewe
64ac6aeb4f - do_repairwc/wc_repair: repair missing "_apiurl" file
- store_read_apiurl: raise WorkingCopyInconsistent if dir is a wc, defaulturl is False
  and ".osc/_apiurl" doesn't exist (otherwise NoWorkingCopy is raised)
- WorkingCopyInconsistent: add new attribute which contains the dirty files
2010-09-28 23:07:33 +02:00
Marcus Huewe
9ad14a1d9c - added new "repairwc" command which tries to repair an inconsistent working copy 2010-09-08 18:56:15 +02:00
Marcus Huewe
5447dfbf12 - initial version of the new update mechanism
TODO: special handling for service files + respect limit_size parameter
2010-08-31 13:30:35 +02:00
Marcus Huewe
e209766084 - renamed "RuntimeError" to "ExtRuntimeError" to avoid confusion with python's "RuntimeError" class
just a "cosmetic" changes
2010-08-16 16:27:00 +02:00
e9b5ca869a support source validators as pre-checkin check 2010-05-20 06:40:18 +02:00
Ludwig Nussel
32e99306b4 add vim mode lines to avoid evil tab characters :-) 2010-02-25 09:53:45 +01:00
Pavol Rusnak
661d927d38 code cleanup 2009-10-20 14:30:15 +00:00
Marcus Hüwe
b5b04124c4 - LinkExpandError inherits from PackageError (display affected project and package in error message) 2009-05-15 19:08:14 +00:00
Michal Cihar
aedeea317c Drop shebang line from modules (bnc#500971).
(Some did have it and some did not, this way it is consistent and they
are anyway not supposed to be executed directly.)
2009-05-05 14:11:25 +00:00
Dr. Peter Poeml
be4f2b031f Putting names at the top of files is is not recommended. Collective wisdom for
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
2009-03-02 14:03:06 +00:00
Marcus Hüwe
c3136c8bf5 - fixed #469167 (don't scare users if they want to commit a nonexistent file ;) )
- removed class UnreadableFile: I don't know why it was introduced at all but it doesn't make any sense => use IOError instead
2009-02-12 13:11:32 +00:00
Marcus Hüwe
3359646b02 - fix bug #412918
- added a file attribute to the ConfigError() class
- added new ConfigMissingApiurl() class
2008-08-07 17:14:26 +00:00
Dr. Peter Poeml
6ff961279c osc update / checkout: don't check out a working copy, or update an existing
one, when a source link cannot be applied [bnc#409373]

 - linkinfo elements can have an "error" attribute which indicates link
   application failure, which means that updating the working copy is not
   possible. 

 - Before this fix, osc could silently remove locally modified sources!
2008-07-16 15:14:57 +00:00
Dirk Mueller
3fb7530028 add an API error type of class to throw 2008-06-20 13:36:45 +00:00
Dr. Peter Poeml
7e524fd442 - osc commit: open $EDITOR for commit message
- osc status: implement -q/--quiet switch
- osc deletepac: allow deletion of multiple packages at once
- osc info: slightly more verbose
- core.edit_message() added
- core.getStatus() accepts new "quiet" argument
- oscerr.UserAbort added
2008-05-21 13:44:49 +00:00
Marcus Hüwe
602c146663 - return a real string instead of an tuple when invoking 'print' on the object 2008-05-03 18:25:24 +00:00
Dr. Peter Poeml
3018460596 Merged revisions 3774-3775,3779,3781-3782,3787,3789-3793,3798,3802,3805,3817-3822,3827,3829-3830,3837-3839,3841-3842,3848-3850 via svnmerge from
https://forgesvn1.novell.com/svn/opensuse/branches/buildservice/osc-exception-handling

........
  r3774 | poeml | 2008-04-22 17:39:45 +0200 (Tue, 22 Apr 2008) | 3 lines
  
  A first draft on implement systematic exception handling: 
  Add errors.py with some exceptions defined, and babysitter.py to handle them
........
  r3775 | poeml | 2008-04-22 22:34:12 +0200 (Tue, 22 Apr 2008) | 9 lines
  
  - new global options:
       --debugger         jump into the debugger before executing anything
       --post-mortem      jump into the debugger in case of errors
       -t, --traceback    print call trace in case of errors
  - traceback and post_mortem can also be set in .oscrc.
  - catch more errors (HTTPError).
  - make config accessible from outside of the Osc instance, by making it a class
    attribute
........
  r3779 | poeml | 2008-04-23 00:55:49 +0200 (Wed, 23 Apr 2008) | 5 lines
  
  - new global option:
       -d, --debug        print info useful for debugging
  - catch some more errors (HTTPError), with OscHTTPError which isn't very
    advanced yet.
........
  r3781 | Marcus_H | 2008-04-23 01:02:00 +0200 (Wed, 23 Apr 2008) | 2 lines
  
  - added OscConfigError class (just for testing).
  - small change in the signature of the OscBaseError constructor (actually we should get rid of the 'args' tuple because it will be deprecated sooner or later
........
  r3782 | Marcus_H | 2008-04-23 02:02:13 +0200 (Wed, 23 Apr 2008) | 2 lines
  
  - access the prg.conf.config dict in a save way - this way we avoid AttributeErrors if the prg.conf.config dict doesn't exist
  - in case of an configparser error we have to use the prg.options object directly (this was removed in r3781 by accident)
........
  r3787 | poeml | 2008-04-23 09:23:56 +0200 (Wed, 23 Apr 2008) | 4 lines
  
  - remove local exception handling from do_req
  - for HTTPError, print details (headers and response) when in debug mode
  - catch AttributeError
........
  r3789 | poeml | 2008-04-23 16:23:14 +0200 (Wed, 23 Apr 2008) | 4 lines
  
  - errors: add two new classes named OscWrongOptionsError and OscWrongArgsError
  - commandline: raise instances of the new errors in a number of places
  - commandline: add get_cmd_help() to Osc instance which returns the formatted help of a subcommand
........
  r3790 | Marcus_H | 2008-04-23 16:48:28 +0200 (Wed, 23 Apr 2008) | 4 lines
  
  - added 2 new exception classes: OscNoConfigfileError and OscIOError
  - added new method write_config() to the conf.py module: This method writes osc's configuration file
  - minor cleanups in the conf module
........
  r3791 | poeml | 2008-04-23 17:11:07 +0200 (Wed, 23 Apr 2008) | 3 lines
  
  small compatibility fix for r3790: try-except-finally isn't supported in
  python-2.4.2, thus do the same as try-except inside a try-finally.
........
  r3792 | poeml | 2008-04-23 17:37:53 +0200 (Wed, 23 Apr 2008) | 2 lines
  
  fix up the remaining places regarding handling of errors related to commandline parsing
........
  r3793 | poeml | 2008-04-23 17:40:34 +0200 (Wed, 23 Apr 2008) | 3 lines
  
  raise a NoWorkingCopyError in osc.core.store_read_project() in case of an
  IOError
........
  r3798 | Marcus_H | 2008-04-23 23:55:24 +0200 (Wed, 23 Apr 2008) | 1 line
  
  ported -r3797 from trunk
........
  r3802 | Marcus_H | 2008-04-24 11:00:55 +0200 (Thu, 24 Apr 2008) | 1 line
  
  ported -r3801 from trunk
........
  r3805 | poeml | 2008-04-24 12:52:30 +0200 (Thu, 24 Apr 2008) | 2 lines
  
  raise OscHTTPError in show_pattern_meta(), replacing local error handling
........
  r3817 | poeml | 2008-04-24 20:21:32 +0200 (Thu, 24 Apr 2008) | 9 lines
  
  - remove errors.OscHTTPError again.
    it seems simpler to use urllib2.HTTPError instead (and just add a specific
    error text message where appropriate, and re-raise)
  - for 404s, check out _which_ part was not found
    it is very ugly, but may be considered Good for pragmatic reasons
  - removed local exception handling and workaround for returned 500's from
    delete_package() and delete_project(), thereby getting rid of 4 possible exit
    points.
........
  r3818 | Marcus_H | 2008-04-24 22:36:17 +0200 (Thu, 24 Apr 2008) | 1 line
  
  - this check is superfluous because every HTTPError instance has a code attribute
........
  r3819 | poeml | 2008-04-25 00:39:39 +0200 (Fri, 25 Apr 2008) | 1 line
  
  remove a forgotten debug line from core.delete_project()
........
  r3820 | poeml | 2008-04-25 10:07:58 +0200 (Fri, 25 Apr 2008) | 2 lines
  
  - ditch local error handling from wipebinaries(), rebuild(), and abortbuild()
........
  r3821 | poeml | 2008-04-25 10:56:38 +0200 (Fri, 25 Apr 2008) | 2 lines
  
  It is never needed to import the exception module.
........
  r3822 | poeml | 2008-04-25 11:13:39 +0200 (Fri, 25 Apr 2008) | 4 lines
  
  - when going into the debugger with --post-mortem, always print a traceback before
    (thus implying -t)
  - do not jump into the debugger if not on a TTY, or working in interactive mode
........
  r3827 | poeml | 2008-04-25 13:07:46 +0200 (Fri, 25 Apr 2008) | 9 lines
  
  - add errors.OscWorkingCopyOutdated, which takes a tuple with three args:
    path to working copy, current rev, expected rev
  - add handler for urllib2.URLError errors to the babysitter
  - simplify the OscWrongArgsError and OscWrongOptionsError handlers, by removing
    the extra line "Sorry, wrong ..." that was printed before the messages given
    when the error was raised.
  - remove one more errors.OscHTTPError which was still there, and raise
    urllib2.HTTPError instead (show_package_meta())
........
  r3829 | poeml | 2008-04-25 14:19:10 +0200 (Fri, 25 Apr 2008) | 11 lines
  
  - comment some methods in osc.core which are used by nearly all do_* methods in
    osc.commandline
  - improve "is not a package/project dir" error messages, by printing the
    absolute path tried, instead of '.' for the cwd
  - make core.store_read_package() raise a proper NoWorkingCopyError instead of
    terminating
  - give attribution to things in babysitter.py copied from mercurial
  - prefix HTTPError exceptions with 'Server returned an error:'
  - remove obsolete local error handling from do_prjresults(), do_importsrcpkg(),
    do_repos()
........
  r3830 | poeml | 2008-04-25 14:29:35 +0200 (Fri, 25 Apr 2008) | 1 line
  
  catch IOError exceptions in the babysitter
........
  r3837 | poeml | 2008-04-25 17:27:36 +0200 (Fri, 25 Apr 2008) | 5 lines
  
  - do_remotebuildlog: raise errors for wrong arguments, remove exits
  - raise AttributeError in make_meta_url() instead of exiting
  - delete unused method core.delete_server_files()
  - replace exit call inside make_meta_url() with an AttributeError 
........
  r3838 | poeml | 2008-04-25 17:49:18 +0200 (Fri, 25 Apr 2008) | 1 line
  
  simplify the check in do_checkout if a project exists, by using show_project_meta() instead of meta_exists
........
  r3839 | poeml | 2008-04-25 18:31:26 +0200 (Fri, 25 Apr 2008) | 6 lines
  
  - commandline do_checkout(): change the order of the two checks, first do the
    (cheaper) check for existing directory
  - core.core checkout_package(): simplify the check in if the package
    exists, by using show_package_meta() instead of meta_exists
    Let it throw an exception, instead of using sys.exit().
........
  r3841 | Marcus_H | 2008-04-27 15:48:06 +0200 (Sun, 27 Apr 2008) | 5 lines
  
  - added 2 new exception classes: PackageError() and PackageExistsError. The PackageError() class is meant to be the base class for all subsequent package exceptions.
  - get rid of 2 sys.exit(1) calls
  - make the update() method of the Project() class safer: in any case we have to write the _packages file otherwise the package tracking will be screwed up.
  - minor fix in delPackage(): use getTransActPath() when printing out the filename
........
  r3842 | Marcus_H | 2008-04-27 16:52:55 +0200 (Sun, 27 Apr 2008) | 3 lines
  
  - make the commit() method safe: in any case we have to write the _packages file otherwise the package tracking will be screwed up.
  - removed another sys.exit(1): raise an exception if a package is missing when doing a commit. For now we use the PackageExistsError() exception but this might change in the future (updated description of PackageExistsError() according to this change)
........
  r3848 | poeml | 2008-04-28 12:46:45 +0200 (Mon, 28 Apr 2008) | 3 lines
  
  rename several error classes, dropping the "Osc" prefix, and "Error" suffix in
  cases where they don't really make sense.
........
  r3849 | poeml | 2008-04-28 12:57:32 +0200 (Mon, 28 Apr 2008) | 3 lines
  
  - rename osc.errors module to osc.oscerr, to make it easier to import it from
    other programs and have a crystal clear namespace
........
  r3850 | poeml | 2008-04-28 13:26:12 +0200 (Mon, 28 Apr 2008) | 2 lines
  
  split PackageExists exception class into PackageExists and PackageMissing
........
2008-04-28 16:37:44 +00:00