This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source devstack/accrc/admin/admin credentials | |
import argparse | |
import pprint | |
import sys | |
from keystoneclient import v3 | |
from keystoneauth1 import loading | |
from keystoneauth1.extras import oauth1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import stevedore | |
mgr = stevedore.ExtensionManager(namespace='keystoneclient.auth.plugin', | |
invoke_on_load=False) | |
def print_plugin(ext): | |
print "%s:" % ext.entry_point.name | |
for opt in ext.plugin.get_options(): | |
print " %s: %s" % (opt.name, opt.help) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import sys | |
from keystoneclient import auth | |
from keystoneclient import session | |
parser = argparse.ArgumentParser('myapp') | |
auth.register_argparse_arguments(parser, sys.argv[1:]) | |
session.Session.register_cli_options(parser) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from keystoneclient import auth | |
from keystoneclient import session | |
from oslo.config import cfg | |
cfg.CONF(sys.argv[1:]) | |
auth.register_conf_options(cfg.CONF, 'somegroup') | |
session.Session.register_conf_options(cfg.CONF, 'somegroup') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# create an associative array of all the changes | |
declare -A MERGED | |
for commit in `git log master | grep Change-Id | cut -d : -f 2`; do | |
MERGED["$commit"]=1 | |
done | |
for branch in `git branch | grep -v master`; do | |
found=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass(object): | |
def __repr__(self): | |
return "<MyClass>" | |
def my_hello(self): | |
print "hello from", self | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import keystoneclient | |
import novaclient | |
# Simple | |
auth = keystoneclient.PasswordAuth(username='jamie', password='cool') | |
s = keystoneclient.Session(cacert='ca.pem', cert='client.pem', key='key.pem', | |
auth=auth) | |
# will send an authenticated request to a full url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ruby | |
## | |
# Take a credit card number and determine the type of card | |
# | |
# @param [String] card the card number | |
# @return [String] the card type. | |
# | |
def card_type(card) | |
if card =~ /^3[47]\d+$/ && card.length == 15 |
NewerOlder