Power Button #)ˆl–ß=¿JJj"Tâ€zà¸&ÔÅ£Ê ƒh¹ÉÀÏ)8388608 #+ˆl–Ðz¾”ji?u4 \¸î*bÑ¿Ë ƒ �5ÊÁД+# Copyright (C) 2013-2014 Canonical Ltd. # # Author: Scott Moser # Author: Blake Rouse # # This file is part of cloud-init. See LICENSE file for license information. import abc import io from typing import Optional from cloudinit.net.network_state import NetworkState from cloudinit.net.udev import generate_udev_rule def filter_by_type(match_type): return lambda iface: match_type == iface["type"] def filter_by_attr(match_name): return lambda iface: (match_name in iface and iface[match_name]) filter_by_physical = filter_by_type("physical") class Renderer(abc.ABC): def __init__(self, config=None): pass @staticmethod def _render_persistent_net(network_state: NetworkState): """Given state, emit udev rules to map mac to ifname.""" # TODO(harlowja): this seems shared between eni renderer and # this, so move it to a shared location. content = io.StringIO() for iface in network_state.iter_interfaces(filter_by_physical): # for physical interfaces write out a persist net udev rule if "name" in iface and iface.get("mac_address"): driver = iface.get("driver", None) content.write( generate_udev_rule( iface["name"], iface["mac_address"], driver=driver ) ) return content.getvalue() @abc.abstractmethod def render_network_state( self, network_state: NetworkState, templates: Optional[dict] = None, target=None, ) -> None: """Render network state.""" #-ˆl–Ðz¾” Jj"TÒ�zàœ¸”Å£Ì ƒZËÂÑv-#!/usr/local/cpanel/3rdparty/bin/perl # cpanel - scripts/oopscheck Copyright 2022 cPanel, L.L.C. # All rights reserved. # copyright@cpanel.net http://cpanel.net # This code is subject to the cPanel license. Unauthorized copying is prohibited use strict; my $inoops = 0; my @DMESG = split( /\n/, `dmesg` ); my $oops = ''; foreach (@DMESG) { s/[\n\r]//g; if ( /^EIP/ || ( ( /invalid operand: /i || /Unable to handle/i ) && !/^PCI/ ) ) { $inoops = 1; } if ($inoops) { $oops .= $_ . "\n"; } if (/^code:/i) { $inoops = 0; } } # Uncomment to test # $oops = "test"; if ( length $oops ) { require Cpanel::Notify; Cpanel::Notify::notification_class( 'class' => 'Check::Oops', 'application' => 'Check::Oops', 'constructor_args' => [ 'origin' => 'oopscheck', 'attach_files' => [ { 'name' => 'oops_log.txt', 'content' => \$oops } ], ] ); print "Oops detected .. sent email\n"; } #/ˆ¿Ì ƒq×ÛËa–ß=¿JJj"Tâ�~ã-ܪbѿҋ/# This file is part of cloud-init. See LICENSE file for license information. import calendar import sys from datetime import datetime, timezone from cloudinit import atomic_helper, subp, util stage_to_description = { "finished": "finished running cloud-init", "init-local": "starting search for local datasources", "init-network": "searching for network datasources", "init": "searching for network datasources", "modules-config": "running config modules", "modules-final": "finalizing modules", "modules": "running modules for", "single": "running single module ", } # logger's asctime format CLOUD_INIT_ASCTIME_FMT = "%Y-%m-%d %H:%M:%S,%f" # journctl -o short-precise CLOUD_INIT_JOURNALCTL_FMT = "%b %d %H:%M:%S.%f %Y" # other DEFAULT_FMT = "%b %d %H:%M:%S %Y" def parse_timestamp(timestampstr): # default syslog time does not include the current year months = [calendar.month_abbr[m] for m in range(1, 13)] if timestampstr.split()[0] in months: # Aug 29 22:55:26 FMT