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 random | |
import string | |
# Returns a random alphanumeric string of length 'length' | |
def random_key(length): | |
key = '' | |
for i in range(length): | |
key += random.choice(string.lowercase + string.uppercase + string.digits) | |
return key |
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
if [ "$(whoami)" != "username" ]; then | |
echo "Script must be run as user: username" | |
exit 255 | |
fi |
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
# Generates a 16 character password. | |
function password { | |
RET=$(cat /dev/urandom | tr -cd [:alnum:] | head -c ${1:-16}) | |
} |
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
def _get_swift_temp_urls(self, url): | |
try: | |
key = SWIFT_TEMP_URL_KEY.encode('ascii', 'ignore') | |
except UnicodeDecodeError: | |
raise ValueError('SWIFT_TEMP_URL_KEY must be an ascii key.') | |
try: | |
temp_url_duration = int(SWIFT_TEMP_URL_DURATION) | |
except ValueError: | |
raise ValueError('SWIFT_TEMP_URL_DURATION must be an integer.') | |
method = SWIFT_TEMP_URL_METHOD |
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
Traceback (most recent call last): | |
File "/usr/local/lib/python2.7/dist-packages/eventlet/hubs/hub.py", line 346, in fire_timers | |
timer() | |
File "/usr/local/lib/python2.7/dist-packages/eventlet/hubs/timer.py", line 56, in __call__ | |
cb(*args, **kw) | |
File "/usr/local/lib/python2.7/dist-packages/eventlet/greenthread.py", line 194, in main | |
result = function(*args, **kwargs) | |
File "/opt/stack/ironic/ironic/conductor/task_manager.py", line 102, in wrapper | |
return f(*args, **kwargs) | |
File "/opt/stack/ironic/ironic/conductor/utils.py", line 54, in node_power_action |
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
Traceback (most recent call last): | |
File "/data/dev/ironic-teeth-driver/.tox/pep8/local/lib/python2.7/site-packages/hacking/core.py", line 427, in is_module_for_sure | |
__import__(mod) | |
File "/data/dev/ironic-teeth-driver/.tox/pep8/src/ironic/ironic/__init__.py", line 22, in <module> | |
eventlet.monkey_patch(os=False) | |
AttributeError: 'module' object has no attribute 'monkey_patch' |
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 csv | |
import requests | |
import sys | |
IRONIC_BASE_URL = "http://10.127.75.253:6385/v1/" | |
def upload(row): | |
payload = { | |
"driver_info": { |
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
Traceback (most recent call last): | |
File "/data/dev/ironic-python-agent/.tox/py27/local/lib/python2.7/site-packages/mock.py", line 1201, in patched | |
return func(*args, **keywargs) | |
File "/data/dev/ironic-python-agent/ironic_python_agent/tests/agent.py", line 253, in test__get_kernel_params_fail | |
params = agent_cmd._get_kernel_params() | |
File "ironic_python_agent/cmd/agent.py", line 31, in _get_kernel_params | |
LOG.exception('Could not read /proc/cmdline: {e}'.format(e=e)) | |
File "/usr/lib/python2.7/logging/__init__.py", line 1445, in exception | |
self.logger.error(msg, *args, **kwargs) | |
File "/usr/lib/python2.7/logging/__init__.py", line 1166, in error |
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
{ | |
'city': 'Oakland, CA', | |
'high': 60.84, | |
'low': 60.84, | |
'sunrise': '2014-05-03 13:09:57', | |
'sunset': '2014-05-04 03:01:49', | |
'temperature': 60.84 | |
'conditions': ['Clouds'], | |
'forecast': [{'date': '2014-05-03', | |
'day': 74.88, |
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
{ | |
"networks": [ // a network is attached to one link and contains a set of L3 configs, such as IP/netmask or whether to dhcp | |
{ | |
"id": "servicenet", //required | |
"type": "ipv4-static", //required | |
"link": "servicenet_vlan", //required, single link | |
"ip": "10.0.0.5", | |
"gateway_ip": "10.0.0.1", | |
"netmask": "255.255.0.0" | |
"dns_nameservers": ["10.0.3.2"], |
OlderNewer