4:10
$ H403
358_•I|¥‰ÓMjqØ‚¦ ë<óo¬Äà f
403 Forbidden
Forbidden
You don't have permission to access this resource.
Additionally, a 403 Forbidden
error was encountered while trying to use an ErrorDocument to handle the request.
ˆÂÁ
ƒh¹ÀÄà f
$ ˆl–Ðz¾”ji?u4 \¸î*bÑ¿Â
„iÆÞ{ÁÅÄ ?÷ #!/usr/bin/env python3
# Copyright (C) 2012 Canonical Ltd.
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# Copyright (C) 2012 Yahoo! Inc.
# Copyright (C) 2017 Amazon.com, Inc. or its affiliates
#
# Author: Scott Moser
# Author: Juerg Haefliger
# Author: Joshua Harlow
# Author: Andrew Jorgensen
#
# This file is part of cloud-init. See LICENSE file for license information.
import argparse
import json
import os
import sys
import traceback
import logging
import yaml
from typing import Optional, Tuple, Callable, Union
from cloudinit import netinfo
from cloudinit import signal_handler
from cloudinit import sources
from cloudinit import socket
from cloudinit import stages
from cloudinit import url_helper
from cloudinit import util
from cloudinit import performance
from cloudinit import version
from cloudinit import warnings
from cloudinit import reporting
from cloudinit import atomic_helper
from cloudinit import lifecycle
from cloudinit import handlers
from cloudinit.log import log_util, loggers
from cloudinit.cmd.devel import read_cfg_paths
from cloudinit.config import cc_set_hostname
from cloudinit.config.modules import Modules
from cloudinit.config.schema import validate_cloudconfig_schema
from cloudinit.lifecycle import log_with_downgradable_level
from cloudinit.reporting import events
from cloudinit.settings import (
PER_INSTANCE,
PER_ALWAYS,
PER_ONCE,
CLOUD_CONFIG,
)
Reason = str
# Welcome message template
WELCOME_MSG_TPL = (
"Cloud-init v. {version} running '{action}' at "
"{timestamp}. Up {uptime} seconds."
)
# Module section template
MOD_SECTION_TPL = "cloud_%s_modules"
# Frequency shortname to full name
# (so users don't have to remember the full name...)
FREQ_SHORT_NAMES = {
"instance": PER_INSTANCE,
"always": PER_ALWAYS,
"once": PER_ONCE,
}
# https://docs.cloud-init.io/en/latest/explanation/boot.html
STAGE_NAME = {
"init-local": "Local Stage",
"init": "Network Stage",
"modules-config": "Config Stage",
"modules-final": "Final Stage",
}
LOG = logging.getLogger(__name__)
# Used for when a logger may not be active
# and we still want to print exceptions...
def print_exc(msg=""):
if msg:
sys.stderr.write("%s\n" % (msg))
sys.stderr.write("-" * 60)
sys.stderr.write("\n")
traceback.print_exc(file=sys.stderr)
sys.stderr.write("-" * 60)
sys.stderr.write("\n")
def welcome(action, msg=None):
if not msg:
msg = welcome_format(action)
log_util.multi_log("%s\n" % (msg), console=False, stderr=True, log=LOG)
return msg
def welcome_format(action):
return WELCOME_MSG_TPL.format(
version=version.version_string(),
uptime=util.uptime(),
timestamp=util.time_rfc2822(),
action=action,
)
@performance.timed("Closing stdin")
def close_stdin(logger: Callable[[str], None] = LOG.debug):
"""
reopen stdin as /dev/null to ensure no side effects
logger: a function for logging messages
"""
if not os.isatty(sys.stdin.fileno()):
logger("Closing stdin")
with open(os.devnull) as fp:
os.dup2(fp.fileno(), sys.stdin.fileno())
else:
logger("Not closing stdin, stdin is a tty.")
def extract_fns(args):
# Files are already opened so lets just pass that along
# since it would of broke if it couldn't have
# read that file already...
fn_cfgs = []
if args.files:
for fh in args.files:
# The realpath is