~axino/charm-haproxy/trunk

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/fetch/__init__.py

  • Committer: mergebot at canonical
  • Author(s): "Barry Price"
  • Date: 2019-03-21 15:28:26 UTC
  • mfrom: (121.1.5 charm-haproxy)
  • Revision ID: mergebot@juju-139df4-prod-is-toolbox-0.canonical.com-20190321152826-kicit95vtrkrqnf0
charm-helpers sync

Reviewed-on: https://code.launchpad.net/~barryprice/charm-haproxy/charm-helpers-sync/+merge/364882
Reviewed-by: Nick Moffitt <nick.moffitt@canonical.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    pass
49
49
 
50
50
 
 
51
class GPGKeyError(Exception):
 
52
    """Exception occurs when a GPG key cannot be fetched or used.  The message
 
53
    indicates what the problem is.
 
54
    """
 
55
    pass
 
56
 
 
57
 
51
58
class BaseFetchHandler(object):
52
59
 
53
60
    """Base class for FetchHandler implementations in fetch plugins"""
77
84
fetch = importlib.import_module(module)
78
85
 
79
86
filter_installed_packages = fetch.filter_installed_packages
80
 
install = fetch.install
81
 
upgrade = fetch.upgrade
82
 
update = fetch.update
83
 
purge = fetch.purge
 
87
filter_missing_packages = fetch.filter_missing_packages
 
88
install = fetch.apt_install
 
89
upgrade = fetch.apt_upgrade
 
90
update = _fetch_update = fetch.apt_update
 
91
purge = fetch.apt_purge
84
92
add_source = fetch.add_source
85
93
 
86
94
if __platform__ == "ubuntu":
87
95
    apt_cache = fetch.apt_cache
88
 
    apt_install = fetch.install
89
 
    apt_update = fetch.update
90
 
    apt_upgrade = fetch.upgrade
91
 
    apt_purge = fetch.purge
 
96
    apt_install = fetch.apt_install
 
97
    apt_update = fetch.apt_update
 
98
    apt_upgrade = fetch.apt_upgrade
 
99
    apt_purge = fetch.apt_purge
 
100
    apt_autoremove = fetch.apt_autoremove
92
101
    apt_mark = fetch.apt_mark
93
102
    apt_hold = fetch.apt_hold
94
103
    apt_unhold = fetch.apt_unhold
 
104
    import_key = fetch.import_key
95
105
    get_upstream_version = fetch.get_upstream_version
96
106
elif __platform__ == "centos":
97
107
    yum_search = fetch.yum_search
135
145
        for source, key in zip(sources, keys):
136
146
            add_source(source, key)
137
147
    if update:
138
 
        fetch.update(fatal=True)
 
148
        _fetch_update(fatal=True)
139
149
 
140
150
 
141
151
def install_remote(source, *args, **kwargs):