404

[ Avaa Bypassed ]




Upload:

Command:

botdev@3.149.236.120: ~ $
#part-handler
# vi: syntax=python ts=4
# this is an example of a version 2 part handler.
# the differences between the initial part-handler version
# and v2 is:
#  * handle_part receives a 5th argument, 'frequency'
#    frequency will be either 'always' or 'per-instance'
#  * handler_version must be set
#
# A handler declaring version 2 will be called on all instance boots, with a
# different 'frequency' argument.

handler_version = 2

def list_types():
    # return a list of mime-types that are handled by this module
    return(["text/plain", "text/go-cubs-go"])

def handle_part(data, ctype, filename, payload, frequency):
    # data: the cloudinit object
    # ctype: '__begin__', '__end__', or the specific mime-type of the part
    # filename: the filename for the part, or dynamically generated part if
    #           no filename is given attribute is present
    # payload: the content of the part (empty for begin or end)
    # frequency: the frequency that this cloud-init run is running for
    #            this is either 'per-instance' or 'always'.  'per-instance'
    #            will be invoked only on the first boot.  'always' will
    #            will be called on subsequent boots.
    if ctype == "__begin__":
       print(f"my handler is beginning, frequency={frequency}")
       return
    if ctype == "__end__":
       print(f"my handler is ending, frequency={frequency}")
       return

    print(f"==== received ctype={ctype} filename={filename} ====")
    print(payload)
    print(f"==== end ctype={ctype} filename={filename}")

Filemanager

Name Type Size Permission Actions
seed Folder 0755
cloud-config-add-apt-repos.txt File 1.54 KB 0644
cloud-config-ansible-controller.txt.gz File 4.31 KB 0644
cloud-config-ansible-managed.txt File 3.73 KB 0644
cloud-config-ansible-pull.txt File 334 B 0644
cloud-config-apt.txt.gz File 5.13 KB 0644
cloud-config-archive-launch-index.txt File 802 B 0644
cloud-config-archive.txt File 239 B 0644
cloud-config-boot-cmds.txt File 636 B 0644
cloud-config-ca-certs.txt File 1.16 KB 0644
cloud-config-chef-oneiric.txt File 3.53 KB 0644
cloud-config-chef.txt.gz File 2.57 KB 0644
cloud-config-datasources.txt File 2.27 KB 0644
cloud-config-disk-setup.txt.gz File 2.83 KB 0644
cloud-config-gluster.txt File 456 B 0644
cloud-config-install-packages.txt File 383 B 0644
cloud-config-launch-index.txt File 570 B 0644
cloud-config-lxd.txt File 1.77 KB 0644
cloud-config-mount-points.txt File 1.47 KB 0644
cloud-config-ntp.txt File 835 B 0644
cloud-config-reporting.txt File 335 B 0644
cloud-config-run-cmds.txt File 963 B 0644
cloud-config-ssh-keys.txt File 3.57 KB 0644
cloud-config-update-apt.txt File 229 B 0644
cloud-config-update-packages.txt File 93 B 0644
cloud-config-user-groups.txt.gz File 2.8 KB 0644
cloud-config-wireguard.txt File 1.16 KB 0644
cloud-config-write-files.txt File 1.05 KB 0644
cloud-config-yum-repo.txt File 639 B 0644
cloud-config.txt.gz File 8.9 KB 0644
include-once.txt File 353 B 0644
include.txt File 434 B 0644
kernel-cmdline.txt File 1 KB 0644
part-handler-v2.txt File 1.53 KB 0644
part-handler.txt File 806 B 0644
plain-ignored.txt File 68 B 0644
user-script.txt File 125 B 0644