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 create_server(i): | |
volume = cloud.create_volume(size=128, bootable=True) | |
try: | |
server = {'name': get_server_name(i)} | |
server['flavorRef'] = cloud.get_flavor('m1.xlarge').id | |
server['networks'] = [{'uuid': cloud.get_network(get_network_name()).id}] | |
server['block_device_mapping_v2'] = [ | |
{ | |
'uuid': volume.id, | |
'boot_index': '0', |
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 openstack | |
import logging | |
cloud = openstack.connect(cloud='vm-10-208') | |
NS = '' | |
def ns(name): | |
return NS + name |
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/env python3 | |
import openstack | |
import logging | |
import time | |
from functools import wraps | |
def timeit(f): | |
@wraps(f) | |
def wrapper(*args, **kwds): |
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/env python3 | |
import openstack | |
import logging | |
import time | |
from functools import wraps | |
def timeit(f): | |
@wraps(f) | |
def wrapper(*args, **kwds): |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright (c) 2020 Red Hat, Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# |
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
#!/usr/bin/python3 | |
# time ./gen_state.py 100 up | nmstatectl set | |
# time ./gen_state.py 100 absent | nmstatectl set | |
import sys | |
header_yml = """ | |
--- | |
interfaces: | |
- name: {base} |
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
select name, migration_is_good from ( | |
select cluster_id, | |
bool_or(only_ipv4) and bool_and(only_ipv4) or | |
bool_or(only_ipv6) and bool_and(only_ipv6) or | |
bool_or(dual_stack) and bool_and(dual_stack) | |
as migration_is_good | |
from ( | |
select addr, | |
ipv6_address, | |
network_attachment.cluster_id, |
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
-- show the names of the affected mac pools to the user | |
select distinct mac_pools.name from | |
-- self join | |
mac_pool_ranges r1 join mac_pool_ranges r2 on | |
( | |
-- mac range which starts inside another | |
(r2.from_mac between r1.from_mac and r1.to_mac) | |
-- mac range which ends inside another | |
or (r2.to_mac between r1.from_mac and r1.to_mac)) | |
-- filter out that every ranges overlaps with itself |
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 | |
set -xe | |
url=http://ftp.hosteurope.de/mirror/centos.org/8-stream/BaseOS/x86_64/os | |
name=centos8-stream-$(date +%F) | |
tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8) | |
img=${name}.img | |
rm -f $img |
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 | |
set -xe | |
[ -n "${1}" ] || exit 1 | |
name=$1 | |
rootpassword=123456 | |
#osvariant=test | |
#osvariant=fedora27 |
NewerOlder