Ejemplo n.º 1
0
#!/usr/bin/env python
#-*- encoding: utf-8 -*-

from glanceclient.v1 import client as glanceclient
from glanceclient import exc as glanceexc
import utils
import keystone

DEBUG = utils.get_debug()


def main():
    try:
        username, password, tenant_name, keystone_url = \
                                                    utils.get_token_config()
        glance_url = utils.get_glance_url()

        if DEBUG:
            print username, password, tenant_name, keystone_url, glance_url

        user = keystone.Keystone(username, password,
                                 tenant_name, keystone_url)
        token = user.get_token()

        # glance_url = 'http://localhost:9292'
        glance = glanceclient.Client(endpoint=glance_url, token=token)

        image = glance.images.create(name='__nvs_monitor__',
                                     data='a' * 1024,
                                     disk_format='qcow2',
                                     container_format='ovf',
Ejemplo n.º 2
0
#! /usr/bin/env python
import numpy as np
import scikits.audiolab as sa 
import subprocess
import math
import matplotlib.pyplot as plt
import shutil 
import os
import utils as ut

DEBUG = ut.get_debug()

"""
returns smallest index of value closest to threshold
@params
    T - the threshold value
    S - the sorted indices, corresponding to the unsorted indices in audio_row1
    audio_row1 - the intensity array   
"""
def find_thresh_ind(T, S, audio_row1):    
    #Find index in array of sorted indices
    # i.e. indices corresponding to sorted values >= T
    ti = -1
    i=0
    while i < S.size: 
        if audio_row1[S[i]]>= T: 
            ti = S[i]
            break
        i+=1
    return i
Ejemplo n.º 3
0
import utils

# Force certain helpers to return consistent values
virtinst._util.is_blktap_capable = lambda: False
virtinst._util.default_bridge2 = lambda ignore1: ["bridge", "eth0"]
virtinst.Guest._open_uri = lambda ignore1, ignore2: None

# Setup logging
rootLogger = logging.getLogger()
for handler in rootLogger.handlers:
    rootLogger.removeHandler(handler)

logging.basicConfig(level=logging.DEBUG, format="%(levelname)-8s %(message)s")

if utils.get_debug():
    rootLogger.setLevel(logging.DEBUG)
else:
    rootLogger.setLevel(logging.ERROR)

# Have imports down here so they get the benefit of logging setup etc.
import capabilities
import validation
import xmlconfig
import image
import storage
import urltest
import clonetest
import nodedev
import virtconvtest
import interface
import utils

# Force certain helpers to return consistent values
virtinst._util.is_blktap_capable = lambda: False
virtinst._util.default_bridge2 = lambda ignore1: ["bridge", "eth0"]
virtinst.Guest._open_uri = lambda ignore1, ignore2: None

# Setup logging
rootLogger = logging.getLogger()
for handler in rootLogger.handlers:
    rootLogger.removeHandler(handler)

logging.basicConfig(level=logging.DEBUG,
                    format="%(levelname)-8s %(message)s")

if utils.get_debug():
    rootLogger.setLevel(logging.DEBUG)
else:
    rootLogger.setLevel(logging.ERROR)


# Have imports down here so they get the benefit of logging setup etc.
import capabilities
import clitest
import clonetest
import image
import interface
import nodedev
import storage
import support
import urltest
Ejemplo n.º 5
0
 def setUp(self):
     self.meter = urlgrabber.progress.BaseMeter()
     if utils.get_debug():
         self.meter = urlgrabber.progress.TextMeter(fo=sys.stdout)
Ejemplo n.º 6
0
 def setUp(self):
     self.meter = urlgrabber.progress.BaseMeter()
     if utils.get_debug():
         self.meter = urlgrabber.progress.TextMeter(fo=sys.stdout)
Ejemplo n.º 7
0
#!/usr/bin/env python
#-*- encoding: utf-8 -*-

"""
Get all network info from nova-network through RPC call to make
sure it is health.
"""

import nova_utils
import utils

DEBUG = utils.get_debug()

try:
    nova_utils.init_nova()
    network_info = nova_utils.rpccall_network('get_all_networks')
    assert network_info
    utils.log(network_info)
except Exception:
    if DEBUG:
        utils.print_traceback()
    result = 'failed'
else:
    result = 'success'

utils.print_result(result)