]> git.pld-linux.org Git - packages/ceph-deploy.git/blob - ceph-deploy-pld.patch
- pl
[packages/ceph-deploy.git] / ceph-deploy-pld.patch
1 From 73a760805b798f9df406402451578d069b95a794 Mon Sep 17 00:00:00 2001
2 From: Joe Handzik <joseph.t.handzik@hp.com>
3 Date: Tue, 7 Apr 2015 15:03:10 -0500
4 Subject: [PATCH 01/14] Updating the url used to clone the remoto repository
5
6 ---
7  vendor.py | 2 +-
8  1 file changed, 1 insertion(+), 1 deletion(-)
9
10 diff --git a/vendor.py b/vendor.py
11 index e1c714d..506e87c 100644
12 --- a/vendor.py
13 +++ b/vendor.py
14 @@ -64,7 +64,7 @@ def vendor_library(name, version, cmd=None):
15              run(['rm', '-rf', vendor_dest])
16  
17      if not path.exists(vendor_dest):
18 -        run(['git', 'clone', 'git://ceph.com/%s' % name])
19 +        run(['git', 'clone', 'https://github.com/alfredodeza/%s.git' % name])
20          os.chdir(vendor_src)
21          run(['git', 'checkout', version])
22          if cmd:
23 -- 
24 2.3.0
25
26
27 From 55d72f4b57cb6da0bd6d4c6207ae0a138d509be7 Mon Sep 17 00:00:00 2001
28 From: Joe Handzik <joseph.t.handzik@hp.com>
29 Date: Wed, 8 Apr 2015 09:53:33 -0500
30 Subject: [PATCH 02/14] Updating github url to point to the ceph fork of remoto
31
32 ---
33  vendor.py | 2 +-
34  1 file changed, 1 insertion(+), 1 deletion(-)
35
36 diff --git a/vendor.py b/vendor.py
37 index 506e87c..5a88856 100644
38 --- a/vendor.py
39 +++ b/vendor.py
40 @@ -64,7 +64,7 @@ def vendor_library(name, version, cmd=None):
41              run(['rm', '-rf', vendor_dest])
42  
43      if not path.exists(vendor_dest):
44 -        run(['git', 'clone', 'https://github.com/alfredodeza/%s.git' % name])
45 +        run(['git', 'clone', 'https://github.com/ceph/%s.git' % name])
46          os.chdir(vendor_src)
47          run(['git', 'checkout', version])
48          if cmd:
49 -- 
50 2.3.0
51
52
53 From 4fce039e050f4657f488371f6da84e724b15b60c Mon Sep 17 00:00:00 2001
54 From: Joe Handzik <joseph.t.handzik@hp.com>
55 Date: Thu, 9 Apr 2015 17:05:35 -0500
56 Subject: [PATCH 03/14] Update the run function to cascade the called process's
57  return code back to its caller
58
59 ---
60  vendor.py | 2 ++
61  1 file changed, 2 insertions(+)
62
63 diff --git a/vendor.py b/vendor.py
64 index 5a88856..f56f1c3 100644
65 --- a/vendor.py
66 +++ b/vendor.py
67 @@ -31,6 +31,8 @@ def run(cmd):
68      if result.wait():
69          print_error(result.stdout.readlines(), result.stderr.readlines())
70  
71 +    return result.returncode
72 +
73  
74  def print_error(stdout, stderr):
75      print '*'*80
76 -- 
77 2.3.0
78
79
80 From dbf5897cf2762b6d3c19f87490822425e3a11d09 Mon Sep 17 00:00:00 2001
81 From: Joe Handzik <joseph.t.handzik@hp.com>
82 Date: Thu, 9 Apr 2015 17:18:28 -0500
83 Subject: [PATCH 04/14] Try the ceph.com mirror first. If that fails, retry
84  with the github url and the https protocol.
85
86 ---
87  vendor.py | 5 ++++-
88  1 file changed, 4 insertions(+), 1 deletion(-)
89
90 diff --git a/vendor.py b/vendor.py
91 index f56f1c3..ef3c52c 100644
92 --- a/vendor.py
93 +++ b/vendor.py
94 @@ -66,7 +66,10 @@ def vendor_library(name, version, cmd=None):
95              run(['rm', '-rf', vendor_dest])
96  
97      if not path.exists(vendor_dest):
98 -        run(['git', 'clone', 'https://github.com/ceph/%s.git' % name])
99 +        rc = run(['git', 'clone', 'git://ceph.com/%s' % name])
100 +        if (rc):
101 +            print "%s: git clone failed using ceph.com url with rc %s, trying github.com" % (path.basename(__file__), rc)
102 +            run(['git', 'clone', 'https://github.com/ceph/%s.git' % name])
103          os.chdir(vendor_src)
104          run(['git', 'checkout', version])
105          if cmd:
106 -- 
107 2.3.0
108
109
110 From 95dce45746a7044b538c03c01631a7e1f0af9bc5 Mon Sep 17 00:00:00 2001
111 From: Joe Handzik <joseph.t.handzik@hp.com>
112 Date: Fri, 10 Apr 2015 10:10:37 -0500
113 Subject: [PATCH 05/14] remove unnecessary parentheses from an if statement
114
115 ---
116  vendor.py | 2 +-
117  1 file changed, 1 insertion(+), 1 deletion(-)
118
119 diff --git a/vendor.py b/vendor.py
120 index ef3c52c..8d6ac6a 100644
121 --- a/vendor.py
122 +++ b/vendor.py
123 @@ -67,7 +67,7 @@ def vendor_library(name, version, cmd=None):
124  
125      if not path.exists(vendor_dest):
126          rc = run(['git', 'clone', 'git://ceph.com/%s' % name])
127 -        if (rc):
128 +        if rc:
129              print "%s: git clone failed using ceph.com url with rc %s, trying github.com" % (path.basename(__file__), rc)
130              run(['git', 'clone', 'https://github.com/ceph/%s.git' % name])
131          os.chdir(vendor_src)
132 -- 
133 2.3.0
134
135
136 From c809d07b8813b0598a6dc6a14ae289be47b4a30f Mon Sep 17 00:00:00 2001
137 From: Ken Dreyer <kdreyer@redhat.com>
138 Date: Fri, 10 Apr 2015 09:18:17 -0600
139 Subject: [PATCH 06/14] doc: add CVE-2015-3010 to changelog
140
141 One of the changes in ceph-deploy 1.5.23 is tracked as CVE-2015-3010.
142 Document this in the changelog.
143
144 Signed-off-by: Ken Dreyer <kdreyer@redhat.com>
145 ---
146  docs/source/changelog.rst | 4 ++--
147  1 file changed, 2 insertions(+), 2 deletions(-)
148
149 diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst
150 index 5363e3b..cb67522 100644
151 --- a/docs/source/changelog.rst
152 +++ b/docs/source/changelog.rst
153 @@ -12,8 +12,8 @@ Changelog
154  * Add ``rgw`` command to easily create rgw instances.
155  * Automatically install the radosgw package.
156  * Remove unimplemented subcommands from CLI and help.
157 -* Fix an issue where keyring permissions were world readable
158 -  (thanks Owen Synge).
159 +* **CVE-2015-3010**: Fix an issue where keyring permissions were
160 +  world readable (thanks Owen Synge).
161  * Fix an issue preventing all but the first host given to
162    ``install --repo`` from being used.
163  
164 -- 
165 2.3.0
166
167
168 From a3940704d7c91e4eabb0d579087b10629163a3d3 Mon Sep 17 00:00:00 2001
169 From: Alfredo Deza <adeza@redhat.com>
170 Date: Wed, 22 Apr 2015 09:31:32 -0400
171 Subject: [PATCH 07/14] update the changelog
172
173 Signed-off-by: Alfredo Deza <adeza@redhat.com>
174 ---
175  docs/source/changelog.rst | 7 +++++++
176  1 file changed, 7 insertions(+)
177
178 diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst
179 index cb67522..9fa009d 100644
180 --- a/docs/source/changelog.rst
181 +++ b/docs/source/changelog.rst
182 @@ -4,6 +4,13 @@ Changelog
183  1.5
184  ---
185  
186 +1.5.24
187 +^^^^^^
188 +**UNRELEASED**
189 +
190 +* Use version 0.0.25 of `remoto` that fixes an issue where output would be cut
191 +  (https://github.com/alfredodeza/remoto/issues/15).
192 +
193  1.5.23
194  ^^^^^^
195  07-Apr-2015
196 -- 
197 2.3.0
198
199
200 From 1f0cd52e9bec1951a476cc3d12b5df4abf715a93 Mon Sep 17 00:00:00 2001
201 From: Alfredo Deza <adeza@redhat.com>
202 Date: Wed, 22 Apr 2015 09:31:57 -0400
203 Subject: [PATCH 08/14] use the new 0.0.25 version of remoto
204
205 Signed-off-by: Alfredo Deza <adeza@redhat.com>
206 ---
207  setup.py | 2 +-
208  1 file changed, 1 insertion(+), 1 deletion(-)
209
210 diff --git a/setup.py b/setup.py
211 index faa4e16..81fcecd 100644
212 --- a/setup.py
213 +++ b/setup.py
214 @@ -24,7 +24,7 @@ if os.environ.get('CEPH_DEPLOY_NO_VENDOR'):
215      clean_vendor('remoto')
216  else:
217      vendorize([
218 -        ('remoto', '0.0.23', ['python', 'vendor.py']),
219 +        ('remoto', '0.0.25', ['python', 'vendor.py']),
220      ])
221  
222  
223 -- 
224 2.3.0
225
226
227 From 4bc9e271d5d5d7715dfd36d0142e8aba2911138e Mon Sep 17 00:00:00 2001
228 From: Travis Rhoden <trhoden@redhat.com>
229 Date: Thu, 7 May 2015 17:43:15 -0400
230 Subject: [PATCH 09/14] Add safe_makedirs function
231
232 safe_makedirs will recursively create paths, just like mkdirs -p
233
234 The "safe" part is that it wont error/except if any of the paths already
235 exist.
236
237 Signed-off-by: Travis Rhoden <trhoden@redhat.com>
238 ---
239  ceph_deploy/hosts/remotes.py | 11 +++++++++++
240  1 file changed, 11 insertions(+)
241
242 diff --git a/ceph_deploy/hosts/remotes.py b/ceph_deploy/hosts/remotes.py
243 index 88812fc..6c8e63a 100644
244 --- a/ceph_deploy/hosts/remotes.py
245 +++ b/ceph_deploy/hosts/remotes.py
246 @@ -296,6 +296,17 @@ def safe_mkdir(path):
247              raise
248  
249  
250 +def safe_makedirs(path):
251 +    """ create path recursively if it doesn't exist """
252 +    try:
253 +        os.makedirs(path)
254 +    except OSError, e:
255 +        if e.errno == errno.EEXIST:
256 +            pass
257 +        else:
258 +            raise
259 +
260 +
261  def zeroing(dev):
262      """ zeroing last few blocks of device """
263      # this kills the crab
264 -- 
265 2.3.0
266
267
268 From 2a0b467bc4f520865a520cf634043c848f1a5989 Mon Sep 17 00:00:00 2001
269 From: Travis Rhoden <trhoden@redhat.com>
270 Date: Thu, 7 May 2015 17:44:37 -0400
271 Subject: [PATCH 10/14] Recursively create /var/lib/ceph/radosgw/... path
272
273 Previously we would fail if /var/lib/ceph/radosgw didn't already
274 exist.  Go ahead and make that directory if needed.
275
276 Signed-off-by: Travis Rhoden <trhoden@redhat.com>
277 ---
278  ceph_deploy/rgw.py | 2 +-
279  1 file changed, 1 insertion(+), 1 deletion(-)
280
281 diff --git a/ceph_deploy/rgw.py b/ceph_deploy/rgw.py
282 index 7364efc..f4e4b1d 100644
283 --- a/ceph_deploy/rgw.py
284 +++ b/ceph_deploy/rgw.py
285 @@ -34,7 +34,7 @@ def create_rgw(distro, name, cluster, init):
286          name=name
287          )
288  
289 -    conn.remote_module.safe_mkdir(path)
290 +    conn.remote_module.safe_makedirs(path)
291  
292      bootstrap_keyring = '/var/lib/ceph/bootstrap-rgw/{cluster}.keyring'.format(
293          cluster=cluster
294 -- 
295 2.3.0
296
297
298 From ff32436139d17074cbc58da0d553ffb2c5f386a1 Mon Sep 17 00:00:00 2001
299 From: Jacek Konieczny <j.konieczny@eggsoft.pl>
300 Date: Tue, 12 May 2015 15:09:52 +0200
301 Subject: [PATCH 11/14] Basic systemd support
302
303 Do not assume systemd is just another variant of sysvinit.
304
305 No point in supporting sysvinit in PLD, the init scripts are
306 overcomplicated.
307 ---
308  ceph_deploy/install.py     |  2 +-
309  ceph_deploy/mds.py         | 10 ++++++++++
310  ceph_deploy/mon.py         |  9 +++++++--
311  ceph_deploy/rgw.py         | 10 ++++++++++
312  ceph_deploy/util/system.py | 26 ++++++++++++++++++--------
313  5 files changed, 46 insertions(+), 11 deletions(-)
314
315 diff --git a/ceph_deploy/install.py b/ceph_deploy/install.py
316 index 8665bd0..ca06721 100644
317 --- a/ceph_deploy/install.py
318 +++ b/ceph_deploy/install.py
319 @@ -69,7 +69,7 @@ def install(args):
320              distro.codename
321          )
322  
323 -        if distro.init == 'sysvinit' and args.cluster != 'ceph':
324 +        if distro.init in ('sysvinit', 'systemd') and args.cluster != 'ceph':
325              LOG.error('refusing to install on host: %s, with custom cluster name: %s' % (
326                      hostname,
327                      args.cluster,
328 diff --git a/ceph_deploy/mds.py b/ceph_deploy/mds.py
329 index 07621d2..01c9d2a 100644
330 --- a/ceph_deploy/mds.py
331 +++ b/ceph_deploy/mds.py
332 @@ -97,6 +97,16 @@ def create_mds(distro, name, cluster, init):
333              ],
334              timeout=7
335          )
336 +    if init == 'systemd':
337 +        remoto.process.run(
338 +            conn,
339 +            [
340 +                'systemctl',
341 +                'start',
342 +                'ceph-mds@{name}.service'.format(name=name),
343 +            ],
344 +            timeout=7
345 +        )
346      elif init == 'sysvinit':
347          remoto.process.run(
348              conn,
349 diff --git a/ceph_deploy/mon.py b/ceph_deploy/mon.py
350 index 9b20944..d70cf82 100644
351 --- a/ceph_deploy/mon.py
352 +++ b/ceph_deploy/mon.py
353 @@ -331,7 +331,12 @@ def destroy_mon(conn, cluster, hostname):
354                  'cluster={cluster}'.format(cluster=cluster),
355                  'id={hostname}'.format(hostname=hostname),
356              ]
357 -
358 +        elif conn.remote_module.path_exists(os.path.join(path, 'systemd')):
359 +            status_args = [
360 +                'systemctl',
361 +                'status',
362 +                'ceph-mon@{hostname}.service'.format(hostname=hostname),
363 +            ]
364          elif conn.remote_module.path_exists(os.path.join(path, 'sysvinit')):
365              status_args = [
366                  'service',
367 @@ -569,7 +574,7 @@ def is_running(conn, args):
368          args
369      )
370      result_string = ' '.join(stdout)
371 -    for run_check in [': running', ' start/running']:
372 +    for run_check in [': running', ' start/running', 'active (running)']:
373          if run_check in result_string:
374              return True
375      return False
376 diff --git a/ceph_deploy/rgw.py b/ceph_deploy/rgw.py
377 index f4e4b1d..4462ba0 100644
378 --- a/ceph_deploy/rgw.py
379 +++ b/ceph_deploy/rgw.py
380 @@ -95,6 +95,16 @@ def create_rgw(distro, name, cluster, init):
381              ],
382              timeout=7
383          )
384 +    elif init == 'systemd':
385 +        remoto.process.run(
386 +            conn,
387 +            [
388 +                'systemctl',
389 +                'start',
390 +                'ceph-radosgw@{name}'.format(name=name),
391 +            ],
392 +            timeout=7
393 +        )
394      elif init == 'sysvinit':
395          remoto.process.run(
396              conn,
397 diff --git a/ceph_deploy/util/system.py b/ceph_deploy/util/system.py
398 index 7665dff..f8e1c81 100644
399 --- a/ceph_deploy/util/system.py
400 +++ b/ceph_deploy/util/system.py
401 @@ -39,14 +39,24 @@ def enable_service(conn, service='ceph'):
402      This function does not do any kind of detection.
403      """
404      if is_systemd(conn):
405 -        remoto.process.run(
406 -            conn,
407 -            [
408 -                'systemctl',
409 -                'enable',
410 -                'ceph',
411 -            ]
412 -        )
413 +        if conn.remote_module.path_exists('/lib/systemd/system/ceph.target'):
414 +            remoto.process.run(
415 +                conn,
416 +                [
417 +                    'systemctl',
418 +                    'enable',
419 +                    'ceph.target',
420 +                ]
421 +            )
422 +        else:
423 +            remoto.process.run(
424 +                conn,
425 +                [
426 +                    'systemctl',
427 +                    'enable',
428 +                    'ceph',
429 +                ]
430 +            )
431      else:
432          remoto.process.run(
433              conn,
434 -- 
435 2.3.0
436
437
438 From c57a04651ea4508b63f5eff536f1be66080b8864 Mon Sep 17 00:00:00 2001
439 From: Jacek Konieczny <j.konieczny@eggsoft.pl>
440 Date: Tue, 12 May 2015 15:11:19 +0200
441 Subject: [PATCH 12/14] PLD Linux support (systemd only)
442
443 Install packages with poldek, control services with systemctl.
444 ---
445  ceph_deploy/hosts/__init__.py         |  5 ++--
446  ceph_deploy/hosts/pld/__init__.py     | 19 ++++++++++++++
447  ceph_deploy/hosts/pld/install.py      | 27 ++++++++++++++++++++
448  ceph_deploy/hosts/pld/mon/__init__.py |  2 ++
449  ceph_deploy/hosts/pld/mon/create.py   | 35 ++++++++++++++++++++++++++
450  ceph_deploy/hosts/pld/pkg.py          | 15 +++++++++++
451  ceph_deploy/hosts/pld/uninstall.py    | 15 +++++++++++
452  ceph_deploy/util/pkg_managers.py      | 47 +++++++++++++++++++++++++++++++++++
453  8 files changed, 163 insertions(+), 2 deletions(-)
454  create mode 100644 ceph_deploy/hosts/pld/__init__.py
455  create mode 100644 ceph_deploy/hosts/pld/install.py
456  create mode 100644 ceph_deploy/hosts/pld/mon/__init__.py
457  create mode 100644 ceph_deploy/hosts/pld/mon/create.py
458  create mode 100644 ceph_deploy/hosts/pld/pkg.py
459  create mode 100644 ceph_deploy/hosts/pld/uninstall.py
460
461 diff --git a/ceph_deploy/hosts/__init__.py b/ceph_deploy/hosts/__init__.py
462 index a662304..0215348 100644
463 --- a/ceph_deploy/hosts/__init__.py
464 +++ b/ceph_deploy/hosts/__init__.py
465 @@ -6,7 +6,7 @@ on the type of distribution/version we are dealing with.
466  """
467  import logging
468  from ceph_deploy import exc
469 -from ceph_deploy.hosts import debian, centos, fedora, suse, remotes, rhel
470 +from ceph_deploy.hosts import debian, centos, fedora, suse, remotes, rhel, pld
471  from ceph_deploy.connection import get_connection
472  
473  logger = logging.getLogger()
474 @@ -60,7 +60,7 @@ def get(hostname,
475      module.normalized_name = _normalized_distro_name(distro_name)
476      module.normalized_release = _normalized_release(release)
477      module.distro = module.normalized_name
478 -    module.is_el = module.normalized_name in ['redhat', 'centos', 'fedora', 'scientific']
479 +    module.is_el = module.normalized_name in ['redhat', 'centos', 'fedora', 'scientific', 'pld']
480      module.release = release
481      module.codename = codename
482      module.conn = conn
483 @@ -82,6 +82,7 @@ def _get_distro(distro, fallback=None, use_rhceph=False):
484          'redhat': centos,
485          'fedora': fedora,
486          'suse': suse,
487 +        'pld': pld,
488          }
489  
490      if distro == 'redhat' and use_rhceph:
491 diff --git a/ceph_deploy/hosts/pld/__init__.py b/ceph_deploy/hosts/pld/__init__.py
492 new file mode 100644
493 index 0000000..bff6a2a
494 --- /dev/null
495 +++ b/ceph_deploy/hosts/pld/__init__.py
496 @@ -0,0 +1,19 @@
497 +import mon  # noqa
498 +import pkg  # noqa
499 +from install import install # noqa
500 +from uninstall import uninstall  # noqa
501 +
502 +# Allow to set some information about this distro
503 +#
504 +
505 +distro = None
506 +release = None
507 +codename = None
508 +
509 +def choose_init():
510 +    """
511 +    Select a init system
512 +
513 +    Returns the name of a init system (upstart, sysvinit ...).
514 +    """
515 +    return 'systemd'
516 diff --git a/ceph_deploy/hosts/pld/install.py b/ceph_deploy/hosts/pld/install.py
517 new file mode 100644
518 index 0000000..610f326
519 --- /dev/null
520 +++ b/ceph_deploy/hosts/pld/install.py
521 @@ -0,0 +1,27 @@
522 +import sys
523 +
524 +from ceph_deploy.lib import remoto
525 +
526 +def install(distro, version_kind, version, adjust_repos):
527 +    logger = distro.conn.logger
528 +    release = distro.release
529 +    machine = distro.machine_type
530 +
531 +    if version_kind not in ['stable', 'testing']:
532 +        logger.error("Only 'stable' and 'testing' supported for PLD")
533 +        sys.exit(1)
534 +
535 +    if version_kind == 'testing':
536 +        sources = ['-n', 'th-test', '-n', 'th-ready', '-n', 'th']
537 +    else:
538 +        sources = ['-n', 'th']
539 +
540 +    remoto.process.run(
541 +        distro.conn,
542 +        [ 'poldek' ] + sources + [
543 +            '--cmd',
544 +            'install',
545 +            'ceph',
546 +            'ceph-radosgw',
547 +        ],
548 +    )
549 diff --git a/ceph_deploy/hosts/pld/mon/__init__.py b/ceph_deploy/hosts/pld/mon/__init__.py
550 new file mode 100644
551 index 0000000..936d5d8
552 --- /dev/null
553 +++ b/ceph_deploy/hosts/pld/mon/__init__.py
554 @@ -0,0 +1,2 @@
555 +from ceph_deploy.hosts.common import mon_add as add  # noqa
556 +from create import create  # noqa
557 diff --git a/ceph_deploy/hosts/pld/mon/create.py b/ceph_deploy/hosts/pld/mon/create.py
558 new file mode 100644
559 index 0000000..19c08a8
560 --- /dev/null
561 +++ b/ceph_deploy/hosts/pld/mon/create.py
562 @@ -0,0 +1,35 @@
563 +from ceph_deploy.hosts import common
564 +from ceph_deploy.lib import remoto
565 +
566 +
567 +def create(distro, args, monitor_keyring):
568 +    hostname = distro.conn.remote_module.shortname()
569 +    common.mon_create(distro, args, monitor_keyring, hostname)
570 +
571 +    remoto.process.run(
572 +        distro.conn,
573 +        [
574 +            'systemctl',
575 +            'enable',
576 +            'ceph-mon@{hostname}.service'.format(hostname=hostname)
577 +        ],
578 +        timeout=7,
579 +    )
580 +    remoto.process.run(
581 +        distro.conn,
582 +        [
583 +            'systemctl',
584 +            'start',
585 +            'ceph-mon@{hostname}.service'.format(hostname=hostname)
586 +        ],
587 +        timeout=7,
588 +    )
589 +    remoto.process.run(
590 +        distro.conn,
591 +        [
592 +            'ceph-create-keys',
593 +            '--cluster', args.cluster,
594 +            '-i', hostname,
595 +        ],
596 +        timeout=7,
597 +    )
598 diff --git a/ceph_deploy/hosts/pld/pkg.py b/ceph_deploy/hosts/pld/pkg.py
599 new file mode 100644
600 index 0000000..64f1857
601 --- /dev/null
602 +++ b/ceph_deploy/hosts/pld/pkg.py
603 @@ -0,0 +1,15 @@
604 +from ceph_deploy.util import pkg_managers
605 +
606 +
607 +def install(distro, packages):
608 +    return pkg_managers.poldek(
609 +        distro.conn,
610 +        packages
611 +    )
612 +
613 +
614 +def remove(distro, packages):
615 +    return pkg_managers.poldek_remove(
616 +        distro.conn,
617 +        packages
618 +    )
619 diff --git a/ceph_deploy/hosts/pld/uninstall.py b/ceph_deploy/hosts/pld/uninstall.py
620 new file mode 100644
621 index 0000000..c047e57
622 --- /dev/null
623 +++ b/ceph_deploy/hosts/pld/uninstall.py
624 @@ -0,0 +1,15 @@
625 +from ceph_deploy.util import pkg_managers
626 +
627 +
628 +def uninstall(conn, purge=False):
629 +    packages = [
630 +        'ceph',
631 +        'ceph-common',
632 +        'radosgw',
633 +        ]
634 +
635 +    pkg_managers.poldek_remove(
636 +        conn,
637 +        packages,
638 +    )
639 +
640 diff --git a/ceph_deploy/util/pkg_managers.py b/ceph_deploy/util/pkg_managers.py
641 index 8985112..ac463c3 100644
642 --- a/ceph_deploy/util/pkg_managers.py
643 +++ b/ceph_deploy/util/pkg_managers.py
644 @@ -164,3 +164,50 @@ def zypper_remove(conn, packages, *a, **kw):
645          *a,
646          **kw
647      )
648 +
649 +def poldek(conn, packages, *a, **kw):
650 +    if isinstance(packages, str):
651 +        packages = [packages]
652 +    cmd = [
653 +        'poldek',
654 +        '--noask',
655 +        '--cmd',
656 +        'install',
657 +    ]
658 +    cmd.extend(packages)
659 +    return remoto.process.run(
660 +        conn,
661 +        cmd,
662 +        *a,
663 +        **kw
664 +    )
665 +
666 +
667 +def poldek_remove(conn, packages, *a, **kw):
668 +    if isinstance(packages, str):
669 +        packages = [packages]
670 +
671 +    cmd = [
672 +        'poldek',
673 +        '--noask',
674 +        'uninstall',
675 +    ]
676 +    cmd.extend(packages)
677 +
678 +    return remoto.process.run(
679 +        conn,
680 +        cmd,
681 +        *a,
682 +        **kw
683 +    )
684 +
685 +
686 +def poldek_update(conn):
687 +    cmd = [
688 +        'poldek',
689 +        '--upa',
690 +    ]
691 +    return remoto.process.run(
692 +        conn,
693 +        cmd,
694 +    )
695 -- 
696 2.3.0
697
698
699 From dc6d218f03d8cfad9a8606dcb016e2e3a45b9a53 Mon Sep 17 00:00:00 2001
700 From: Jacek Konieczny <j.konieczny@eggsoft.pl>
701 Date: Wed, 13 May 2015 11:08:15 +0200
702 Subject: [PATCH 13/14] pld: fix 'purge' action
703
704 - properly remove the packages installed with 'install'
705 - remove stale /etc/systemd/system/ceph.target.wants symlinks
706 ---
707  ceph_deploy/hosts/pld/uninstall.py | 10 ++++++----
708  ceph_deploy/util/pkg_managers.py   |  3 ++-
709  2 files changed, 8 insertions(+), 5 deletions(-)
710
711 diff --git a/ceph_deploy/hosts/pld/uninstall.py b/ceph_deploy/hosts/pld/uninstall.py
712 index c047e57..c7a5ee5 100644
713 --- a/ceph_deploy/hosts/pld/uninstall.py
714 +++ b/ceph_deploy/hosts/pld/uninstall.py
715 @@ -1,15 +1,17 @@
716  from ceph_deploy.util import pkg_managers
717 -
718 +from ceph_deploy.lib import remoto
719  
720  def uninstall(conn, purge=False):
721      packages = [
722          'ceph',
723 -        'ceph-common',
724 -        'radosgw',
725 +        'ceph-radosgw',
726          ]
727  
728      pkg_managers.poldek_remove(
729          conn,
730          packages,
731      )
732 -
733 +    remoto.process.run(
734 +        conn,
735 +        ['sh', '-c', 'rm -f /etc/systemd/system/ceph.target.wants/* || :']
736 +    )
737 diff --git a/ceph_deploy/util/pkg_managers.py b/ceph_deploy/util/pkg_managers.py
738 index ac463c3..d7db533 100644
739 --- a/ceph_deploy/util/pkg_managers.py
740 +++ b/ceph_deploy/util/pkg_managers.py
741 @@ -190,7 +190,8 @@ def poldek_remove(conn, packages, *a, **kw):
742      cmd = [
743          'poldek',
744          '--noask',
745 -        'uninstall',
746 +        '--cmd',
747 +        'uninstall'
748      ]
749      cmd.extend(packages)
750  
751 -- 
752 2.3.0
753
754
755 From bfd4cdafbf34fd34f777038ad8c2efa10e7bc32f Mon Sep 17 00:00:00 2001
756 From: Jacek Konieczny <j.konieczny@eggsoft.pl>
757 Date: Wed, 13 May 2015 13:18:22 +0200
758 Subject: [PATCH 14/14] bootstrap script updated for PLD
759
760 ---
761  bootstrap | 13 +++++++++++++
762  1 file changed, 13 insertions(+)
763
764 diff --git a/bootstrap b/bootstrap
765 index 9b6fda8..c11f413 100755
766 --- a/bootstrap
767 +++ b/bootstrap
768 @@ -16,6 +16,19 @@ if command -v lsb_release >/dev/null 2>&1; then
769                         exit 1
770             fi
771             ;;
772 +       PLD)
773 +           for package in python-virtualenv; do
774 +               if ! rpm -q $package >/dev/null 2>&1; then
775 +                    # add a space after old values
776 +                   missing="${missing:+$missing }$package"
777 +               fi
778 +           done
779 +           if [ -n "$missing" ]; then
780 +                       echo "$0: missing required packages, please install them:" 1>&2
781 +                       echo "  poldek --cmd install $missing"
782 +                       exit 1
783 +           fi
784 +           ;;
785      esac
786  
787      case "$(lsb_release --id --short | awk '{print $1}')" in
788 -- 
789 2.3.0
790
This page took 0.287976 seconds and 3 git commands to generate.