From 89e7afbf74ffbbb54dd892bf2c4245aedee2a832 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Tue, 9 Dec 2014 11:10:24 -0600 Subject: Remove blanket excepts from plugins and lint This removes most blanket except: clauses from all plugins, including the base plugin libraries, and bcfg2-lint. The few that remain should all be necessary. Most of the changes were quite minor, but this did require some restructuring of the CfgPrivateKeyCreator; as a result, the tests for that module were rewritten. --- src/lib/Bcfg2/Server/Plugins/Packages/Source.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/lib/Bcfg2/Server/Plugins/Packages/Source.py') diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Source.py b/src/lib/Bcfg2/Server/Plugins/Packages/Source.py index 67ada2399..c9f6ea14a 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/Source.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/Source.py @@ -331,10 +331,11 @@ class Source(Debuggable): # pylint: disable=R0902 @track_statistics() def setup_data(self, force_update=False): - """ Perform all data fetching and setup tasks. For most - backends, this involves downloading all metadata from the - repository, parsing it, and caching the parsed data locally. - The order of operations is: + """Perform all data fetching and setup tasks. + + For most backends, this involves downloading all metadata from + the repository, parsing it, and caching the parsed data + locally. The order of operations is: #. Call :func:`load_state` to try to load data from the local cache. @@ -352,6 +353,15 @@ class Source(Debuggable): # pylint: disable=R0902 upstream repository. :type force_update: bool """ + # there are a bunch of wildcard except statements here, + # because the various functions called herein (``load_state``, + # ``read_files``, ``update``) are defined entirely by the + # Packages plugins that implement them. + # + # TODO: we should define an exception subclass that each of + # these functions can raise when an *expected* error condition + # is encountered. + # # pylint: disable=W0702 if not force_update: if os.path.exists(self.cachefile): -- cgit v1.2.3-1-g7c22