Esempio n. 1
0
from __future__ import print_function

import argparse
import logging
import sys

import httplib2

import ironicclient
from ironicclient import client as iroclient
from ironicclient.common import utils
from ironicclient import exc
from ironicclient.openstack.common import cliutils
from ironicclient.openstack.common import gettextutils

gettextutils.install('ironicclient')


class IronicShell(object):

    def get_base_parser(self):
        parser = argparse.ArgumentParser(
            prog='ironic',
            description=__doc__.strip(),
            epilog='See "ironic help COMMAND" '
                   'for help on a specific command.',
            add_help=False,
            formatter_class=HelpFormatter,
        )

        # Global arguments
Esempio n. 2
0
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

from keystoneclient.v2_0 import client as ksclient

from ironicclient.common import utils
from ironicclient import exc
from ironicclient.openstack.common import gettextutils

gettextutils.install('ironicclient')


def _get_ksclient(**kwargs):
    """Get an endpoint and auth token from Keystone.

    :param kwargs: keyword args containing credentials:
            * username: name of user
            * password: user's password
            * auth_url: endpoint to authenticate against
            * insecure: allow insecure SSL (no cert verification)
            * tenant_{name|id}: name or ID of tenant
    """
    return ksclient.Client(username=kwargs.get('username'),
                           password=kwargs.get('password'),
                           tenant_id=kwargs.get('tenant_id'),
#
"""Extracts OpenStack config option info from module(s)."""

import imp
import os
import re
import socket
import sys
import textwrap

from oslo.config import cfg

from ironicclient.openstack.common import gettextutils
from ironicclient.openstack.common import importutils

gettextutils.install('python-ironicclient')

STROPT = "StrOpt"
BOOLOPT = "BoolOpt"
INTOPT = "IntOpt"
FLOATOPT = "FloatOpt"
LISTOPT = "ListOpt"
MULTISTROPT = "MultiStrOpt"

OPT_TYPES = {
    STROPT: 'string value',
    BOOLOPT: 'boolean value',
    INTOPT: 'integer value',
    FLOATOPT: 'floating point value',
    LISTOPT: 'list value',
    MULTISTROPT: 'multi valued',