PRODUCT=11/1/1/ab41
NAME="AT Translated Set 2 keyboard"
PHYS="isa0060/serio0/input0"
PROP=0
EV=120013
KEY=402000000 3803078f800d001 feffffdfffefffff fffffffffffffffe
MSC=10
LED=7
MODALIAS=input:b0011v0001p0001eAB41-e0,1,4,11,14,k71,72,73,74,75,76,77,79,7A,7B,7C,7D,7E,7F,80,8C,8E,8F,9B,9C,9D,9E,9F,A3,A4,A5,A6,AC,AD,B7,B8,B9,D9,E2,ram4,l0,1,2,sfw
     7= p    7# Copyright 2014 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
#   Redistributions of source code must retain the above copyright notice,
#   this list of conditions and the following disclaimer.
#
#   Redistributions in binary form must reproduce the above copyright
#   notice, this list of conditions and the following disclaimer in the
#   documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from requestbuilder import Arg

from euca2ools.commands.ec2 import EC2Request


class DeleteNetworkInterface(EC2Request):
    DESCRIPTION = 'Delete a VPC network interface'
    ARGS = [Arg('NetworkInterfaceId', metavar='INTERFACE',
                help='ID of the network interface to delete (required)')]
     9 >    9# Copyright (C) 2015 Red Hat, Inc.
#
# Author: Brent Baude <bbaude@redhat.com>
#
# This file is part of cloud-init. See LICENSE file for license information.

"""
RedHat Subscription
-------------------
**Summary:** register red hat enterprise linux based system

Register a RedHat system either by username and password *or* activation and
org. Following a sucessful registration, you can auto-attach subscriptions, set
the service level, add subscriptions based on pool id, enable/disable yum
repositories based on repo id, and alter the rhsm_baseurl and server-hostname
in ``/etc/rhsm/rhs.conf``. For more details, see the ``Register RedHat
Subscription`` example config.

**Internal name:** ``cc_rh_subscription``

**Module frequency:** per instance

**Supported distros:** rhel, fedora

**Config keys**::

    rh_subscription:
        username: <username>
        password: <password>
        activation-key: <activation key>
        org: <org number>
        auto-attach: <true/false>
        service-level: <service level>
        add-pool: <list of pool ids>
        enable-repo: <list of yum repo ids>
        disable-repo: <list of yum repo ids>
        rhsm-baseurl: <url>
        server-hostname: <hostname>
"""

from cloudinit import log as logging
from cloudinit import util

LOG = logging.getLogger(__name__)

distros = ['fedora', 'rhel']


def handle(name, cfg, _cloud, log, _args):
    sm = SubscriptionManager(cfg, log=log)
    if not sm.is_configured():
        log.debug("%s: module not configured.", name)
        return None

    if not sm.is_registered():
        try:
            verify, verify_msg = sm._verify_keys()
            if verify is not True:
                raise SubscriptionError(verify_msg)
            cont = sm.rhn_register()
            if not cont:
                raise SubscriptionError("Registration failed or did not "
                                        "run completely")

            # Splitting up the registration, auto-attach, and servicelevel
            # commands because the error c