0
     ‡ˆÊáƒM¿ß      ‡# Copyright 2012 Red Hat Inc.
# Guy Streeter <streeter@redhat.com>

# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General Public License.
#
# See the LICENSE file in the source distribution for further information.

from sos.plugins import Plugin, RedHatPlugin


class KernelRT(Plugin, RedHatPlugin):
    """Realtime kernel variant
    """

    plugin_name = 'kernelrt'
    profiles = ('system', 'hardware', 'kernel', 'mrg')

    # this file exists only when the realtime kernel is booted
    # this plugin will not be called is this file does not exist
    files = ('/sys/kernel/realtime',)

    def setup(self):
        clocksource_path = '/sys/devices/system/clocksource/clocksource0/'
        self.add_copy_spec([
            '/etc/rtgroups',
            '/proc/sys/kernel/sched_rt_period_us',
            '/proc/sys/kernel/sched_rt_runtime_us',
            '/sys/kernel/realtime',
            clocksource_path + 'available_clocksource',
            clocksource_path + 'current_clocksource'
        ])
        # note: rhbz#1059685 'tuna - NameError: global name 'cgroups' is not
        # defined this command throws an exception on versions prior to
        # 0.10.4-5.
        self.add_cmd_output('tuna -CP')

# vim: set et ts=4 sw=4 :
  "   ‰ˆ×áƒA{a–äY>”ËmJqA3q¡\eÅ1hßà Š    ‰ó
oBú]c           @   sK   d  Z  d d l Z d d l m Z d d l m Z e Z d Z d „  Z d S(   sB  
Scripts User
------------
**Summary:** run user scripts

This module runs all user scripts. User scripts are not specified in the
``scripts`` directory in the datasource, but rather are present in the
``scripts`` dir in the instance configuration. Any cloud-config parts with a
``#!`` will be treated as a script and run. Scripts specified as cloud-config
parts will be run in the order they are specified in the configuration.
This module does not accept any config keys.

**Internal name:** ``cc_scripts_user``

**Module frequency:** per instance

**Supported distros:** all
iÿÿÿÿN(   t   util(   t   PER_INSTANCEt   scriptsc         C   s]   t  j j | j ƒ  t ƒ } y t j | ƒ Wn* t k
 rX | j d |  t | ƒ ‚  n Xd  S(   Ns"   Failed to run module %s (%s in %s)(	   t   ost   patht   joint   get_ipath_curt   SCRIPT_SUBDIRR    t   runpartst	   Exceptiont   warning(   t   namet   _cfgt   cloudt   logt   _argst   runparts_path(    (    sD   /usr/lib/python2.7/site-packages/cloudinit/config/cc_scripts_user.pyt   handle'   s    	(	   t   __doc__R   t	   cloudinitR    t   cloudinit.settingsR   t	   frequencyR   R   (    (    (    sD   /usr/lib/python2.7/site-packages/cloudinit/config/cc_scripts_user.pyt   <module>   s        ‹ˆËâƒeæ]¾à ý    ‹# Copyright (C) 2019 Red Hat, Inc., Lee Yarwood <lyarwood@redhat.com>

# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General Public License.
#
# See the LICENSE file in the source distribution for further information.

from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin


class OpenStackPlacement(Plugin):
    """OpenStack Placement
    """
    plugin_name = "openstack_placement"
    profiles = ('openstack', 'openstack_controller')

    var_puppet_gen = "/var/lib/config-data/puppet-generated/placement"

    def setup(self):

        # collect commands output only if the openstack-placement-api service
        # is running

        in_container = self.running_in_container()

        if self.is_service_running('openstack-placement-api') or in_container:
            placement_config = ""
            # if containerized we need to pass the config to the cont.
            if in_container:
            