~openstack-charmers-archive/charms/precise/ceilometer-agent/trunk

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/contrib/storage/linux/ceph.py

  • Committer: Liam Young
  • Date: 2015-01-26 09:48:30 UTC
  • Revision ID: liam.young@canonical.com-20150126094830-cydd9k25gaoymbc4
[gnuoy,trivial] Pre-release charmhelper sync

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2014-2015 Canonical Limited.
 
2
#
 
3
# This file is part of charm-helpers.
 
4
#
 
5
# charm-helpers is free software: you can redistribute it and/or modify
 
6
# it under the terms of the GNU Lesser General Public License version 3 as
 
7
# published by the Free Software Foundation.
 
8
#
 
9
# charm-helpers is distributed in the hope that it will be useful,
 
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
# GNU Lesser General Public License for more details.
 
13
#
 
14
# You should have received a copy of the GNU Lesser General Public License
 
15
# along with charm-helpers.  If not, see <http://www.gnu.org/licenses/>.
 
16
 
1
17
#
2
18
# Copyright 2012 Canonical Ltd.
3
19
#
157
173
    log('Created new ceph keyring at %s.' % keyring, level=DEBUG)
158
174
 
159
175
 
 
176
def delete_keyring(service):
 
177
    """Delete an existing Ceph keyring."""
 
178
    keyring = _keyring_path(service)
 
179
    if not os.path.exists(keyring):
 
180
        log('Keyring does not exist at %s' % keyring, level=WARNING)
 
181
        return
 
182
 
 
183
    os.remove(keyring)
 
184
    log('Deleted ring at %s.' % keyring, level=INFO)
 
185
 
 
186
 
160
187
def create_key_file(service, key):
161
188
    """Create a file containing key."""
162
189
    keyfile = _keyfile_path(service)