Merge pull request #32637 from makefu/pkgs/openstack/nuke

nuke openstack (again)
This commit is contained in:
Jörg Thalheim 2017-12-15 10:06:23 -08:00 committed by GitHub
commit 5687f61b19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 17 additions and 2719 deletions

View File

@ -281,8 +281,8 @@
stanchion = 262;
riak-cs = 263;
infinoted = 264;
keystone = 265;
glance = 266;
# keystone = 265; # unused, removed 2017-12-13
# glance = 266; # unused, removed 2017-12-13
couchpotato = 267;
gogs = 268;
pdns-recursor = 269;
@ -551,8 +551,8 @@
stanchion = 262;
riak-cs = 263;
infinoted = 264;
keystone = 265;
glance = 266;
# keystone = 265; # unused, removed 2017-12-13
# glance = 266; # unused, removed 2017-12-13
couchpotato = 267;
gogs = 268;
kresd = 270;

View File

@ -749,6 +749,4 @@
./virtualisation/vmware-guest.nix
./virtualisation/xen-dom0.nix
./virtualisation/xe-guest-utilities.nix
./virtualisation/openstack/keystone.nix
./virtualisation/openstack/glance.nix
]

View File

@ -1,174 +0,0 @@
# Module for Nova, a.k.a. OpenStack Compute.
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.virtualisation.nova;
nova = pkgs.nova;
novaConf = pkgs.writeText "nova.conf"
''
--nodaemon
--verbose
${cfg.extraConfig}
'';
in
{
###### interface
options = {
virtualisation.nova.enableSingleNode =
mkOption {
default = false;
description =
''
This option enables Nova, also known as OpenStack Compute,
a cloud computing system, as a single-machine
installation. That is, all of Nova's components are
enabled on this machine, using SQLite as Nova's database.
This is useful for evaluating and experimenting with Nova.
However, for a real cloud computing environment, you'll
want to enable some of Nova's services on other machines,
and use a database such as MySQL.
'';
};
virtualisation.nova.extraConfig =
mkOption {
default = "";
description =
''
Additional text appended to <filename>nova.conf</filename>,
the main Nova configuration file.
'';
};
};
###### implementation
config = mkIf cfg.enableSingleNode {
environment.systemPackages = [ nova pkgs.euca2ools pkgs.novaclient ];
environment.etc =
[ { source = novaConf;
target = "nova/nova.conf";
}
];
# Nova requires libvirtd and RabbitMQ.
virtualisation.libvirtd.enable = true;
services.rabbitmq.enable = true;
# `qemu-nbd' required the `nbd' kernel module.
boot.kernelModules = [ "nbd" ];
system.activationScripts.nova =
''
mkdir -m 755 -p /var/lib/nova
mkdir -m 755 -p /var/lib/nova/networks
mkdir -m 700 -p /var/lib/nova/instances
mkdir -m 700 -p /var/lib/nova/keys
# Allow the CA certificate generation script (called by
# nova-api) to work.
mkdir -m 700 -p /var/lib/nova/CA /var/lib/nova/CA/private
# Initialise the SQLite database.
${nova}/bin/nova-manage db sync
'';
# `nova-api' receives and executes external client requests from
# tools such as euca2ools. It listens on port 8773 (XML) and 8774
# (JSON).
jobs.nova_api =
{ name = "nova-api";
description = "Nova API service";
startOn = "ip-up";
# `openssl' is required to generate the CA. `openssh' is
# required to generate key pairs.
path = [ pkgs.openssl config.programs.ssh.package pkgs.bash ];
respawn = false;
exec = "${nova}/bin/nova-api --flagfile=${novaConf} --api_paste_config=${nova}/etc/nova/api-paste.ini";
};
# `nova-objectstore' is a simple image server. Useful if you're
# not running the OpenStack Imaging Service (Swift). It serves
# images placed in /var/lib/nova/images/.
jobs.nova_objectstore =
{ name = "nova-objectstore";
description = "Nova Simple Object Store Service";
startOn = "ip-up";
preStart =
''
mkdir -m 700 -p /var/lib/nova/images
'';
exec = "${nova}/bin/nova-objectstore --flagfile=${novaConf}";
};
# `nova-scheduler' schedules VM execution requests.
jobs.nova_scheduler =
{ name = "nova-scheduler";
description = "Nova Scheduler Service";
startOn = "ip-up";
exec = "${nova}/bin/nova-scheduler --flagfile=${novaConf}";
};
# `nova-compute' starts and manages virtual machines.
jobs.nova_compute =
{ name = "nova-compute";
description = "Nova Compute Service";
startOn = "ip-up";
path =
[ pkgs.sudo pkgs.vlan pkgs.nettools pkgs.iptables pkgs.qemu_kvm
pkgs.e2fsprogs pkgs.utillinux pkgs.multipath-tools pkgs.iproute
pkgs.bridge-utils
];
exec = "${nova}/bin/nova-compute --flagfile=${novaConf}";
};
# `nova-network' manages networks and allocates IP addresses.
jobs.nova_network =
{ name = "nova-network";
description = "Nova Network Service";
startOn = "ip-up";
path =
[ pkgs.sudo pkgs.vlan pkgs.dnsmasq pkgs.nettools pkgs.iptables
pkgs.iproute pkgs.bridge-utils pkgs.radvd
];
exec = "${nova}/bin/nova-network --flagfile=${novaConf}";
};
};
}

View File

@ -1,84 +0,0 @@
{ lib }:
with lib;
rec {
# A shell script string helper to get the value of a secret at
# runtime.
getSecret = secretOption:
if secretOption.storage == "fromFile"
then ''$(cat ${secretOption.value})''
else ''${secretOption.value}'';
# A shell script string help to replace at runtime in a file the
# pattern of a secret by its value.
replaceSecret = secretOption: filename: ''
sed -i "s/${secretOption.pattern}/${getSecret secretOption}/g" ${filename}
'';
# This generates an option that can be used to declare secrets which
# can be stored in the nix store, or not. A pattern is written in
# the nix store to represent the secret. The pattern can
# then be overwritten with the value of the secret at runtime.
mkSecretOption = {name, description ? ""}:
mkOption {
description = description;
type = types.submodule ({
options = {
pattern = mkOption {
type = types.str;
default = "##${name}##";
description = "The pattern that represent the secret.";
};
storage = mkOption {
type = types.enum [ "fromNixStore" "fromFile" ];
description = ''
Choose the way the password is provisionned. If
fromNixStore is used, the value is the password and it is
written in the nix store. If fromFile is used, the value
is a path from where the password will be read at
runtime. This is generally used with <link
xlink:href="https://nixos.org/nixops/manual/#opt-deployment.keys">
deployment keys</link> of Nixops.
'';};
value = mkOption {
type = types.str;
description = ''
If the storage is fromNixStore, the value is the password itself,
otherwise it is a path to the file that contains the password.
'';
};
};});
};
databaseOption = name: {
host = mkOption {
type = types.str;
default = "localhost";
description = ''
Host of the database.
'';
};
name = mkOption {
type = types.str;
default = name;
description = ''
Name of the existing database.
'';
};
user = mkOption {
type = types.str;
default = name;
description = ''
The database user. The user must exist and has access to
the specified database.
'';
};
password = mkSecretOption {
name = name + "MysqlPassword";
description = "The database user's password";};
};
}

View File

@ -1,245 +0,0 @@
{ config, lib, pkgs, ... }:
with lib; with import ./common.nix {inherit lib;};
let
cfg = config.virtualisation.openstack.glance;
commonConf = ''
[database]
connection = "mysql://${cfg.database.user}:${cfg.database.password.pattern}@${cfg.database.host}/${cfg.database.name}"
notification_driver = noop
[keystone_authtoken]
auth_url = ${cfg.authUrl}
auth_plugin = password
project_name = service
project_domain_id = default
user_domain_id = default
username = ${cfg.serviceUsername}
password = ${cfg.servicePassword.pattern}
[glance_store]
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
'';
glanceApiConfTpl = pkgs.writeText "glance-api.conf" ''
${commonConf}
[paste_deploy]
flavor = keystone
config_file = ${cfg.package}/etc/glance-api-paste.ini
'';
glanceRegistryConfTpl = pkgs.writeText "glance-registry.conf" ''
${commonConf}
[paste_deploy]
config_file = ${cfg.package}/etc/glance-registry-paste.ini
'';
glanceApiConf = "/var/lib/glance/glance-api.conf";
glanceRegistryConf = "/var/lib/glance/glance-registry.conf";
in {
options.virtualisation.openstack.glance = {
package = mkOption {
type = types.package;
default = pkgs.glance;
defaultText = "pkgs.glance";
description = ''
Glance package to use.
'';
};
enable = mkOption {
default = false;
type = types.bool;
description = ''
This option enables Glance as a single-machine
installation. That is, all of Glance's components are
enabled on this machine. This is useful for evaluating and
experimenting with Glance. Note we are currently not
providing any configurations for a multi-node setup.
'';
};
authUrl = mkOption {
type = types.str;
default = http://localhost:5000;
description = ''
Complete public Identity (Keystone) API endpoint. Note this is
unversionned.
'';
};
serviceUsername = mkOption {
type = types.str;
default = "glance";
description = ''
The Glance service username. This user is created if bootstrap
is enable, otherwise it has to be manually created before
starting this service.
'';
};
servicePassword = mkSecretOption {
name = "glanceAdminPassword";
description = ''
The Glance service user's password.
'';
};
database = databaseOption "glance";
bootstrap = {
enable = mkOption {
default = false;
type = types.bool;
description = ''
Bootstrap the Glance service by creating the service tenant,
an admin account and a public endpoint. This option provides
a ready-to-use glance service. This is only done at the
first Glance execution by the systemd post start section.
The keystone admin account is used to create required
Keystone resource for the Glance service.
<note><para> This option is a helper for setting up
development or testing environments.</para></note>
'';
};
endpointPublic = mkOption {
type = types.str;
default = "http://localhost:9292";
description = ''
The public image endpoint. The link <link
xlink:href="http://docs.openstack.org/liberty/install-guide-rdo/keystone-services.html">
create endpoint</link> provides more informations
about that.
'';
};
keystoneAdminUsername = mkOption {
type = types.str;
default = "admin";
description = ''
The keystone admin user name used to create the Glance account.
'';
};
keystoneAdminPassword = mkSecretOption {
name = "keystoneAdminPassword";
description = ''
The keystone admin user's password.
'';
};
keystoneAdminTenant = mkOption {
type = types.str;
default = "admin";
description = ''
The keystone admin tenant used to create the Glance account.
'';
};
keystoneAuthUrl = mkOption {
type = types.str;
default = "http://localhost:5000/v2.0";
description = ''
The keystone auth url used to create the Glance account.
'';
};
};
};
config = mkIf cfg.enable {
users.extraUsers = [{
name = "glance";
group = "glance";
uid = config.ids.gids.glance;
}];
users.extraGroups = [{
name = "glance";
gid = config.ids.gids.glance;
}];
systemd.services.glance-registry = {
description = "OpenStack Glance Registry Daemon";
after = [ "network.target"];
path = [ pkgs.curl pkgs.pythonPackages.keystoneclient pkgs.gawk ];
wantedBy = [ "multi-user.target" ];
preStart = ''
mkdir -m 775 -p /var/lib/glance/{images,scrubber,image_cache}
chown glance:glance /var/lib/glance/{images,scrubber,image_cache}
# Secret file managment
cp ${glanceRegistryConfTpl} ${glanceRegistryConf};
chown glance:glance ${glanceRegistryConf};
chmod 640 ${glanceRegistryConf}
${replaceSecret cfg.database.password glanceRegistryConf}
${replaceSecret cfg.servicePassword glanceRegistryConf}
cp ${glanceApiConfTpl} ${glanceApiConf};
chown glance:glance ${glanceApiConf};
chmod 640 ${glanceApiConf}
${replaceSecret cfg.database.password glanceApiConf}
${replaceSecret cfg.servicePassword glanceApiConf}
# Initialise the database
${cfg.package}/bin/glance-manage --config-file=${glanceApiConf} --config-file=${glanceRegistryConf} db_sync
'';
postStart = ''
set -eu
export OS_AUTH_URL=${cfg.bootstrap.keystoneAuthUrl}
export OS_USERNAME=${cfg.bootstrap.keystoneAdminUsername}
export OS_PASSWORD=${getSecret cfg.bootstrap.keystoneAdminPassword}
export OS_TENANT_NAME=${cfg.bootstrap.keystoneAdminTenant}
# Wait until the keystone is available for use
count=0
while ! keystone user-get ${cfg.bootstrap.keystoneAdminUsername} > /dev/null
do
if [ $count -eq 30 ]
then
echo "Tried 30 times, giving up..."
exit 1
fi
echo "Keystone not yet started. Waiting for 1 second..."
count=$((count++))
sleep 1
done
# If the service glance doesn't exist, we consider glance is
# not initialized
if ! keystone service-get glance
then
keystone service-create --type image --name glance
ID=$(keystone service-get glance | awk '/ id / { print $4 }')
keystone endpoint-create --region RegionOne --service $ID --internalurl http://localhost:9292 --adminurl http://localhost:9292 --publicurl ${cfg.bootstrap.endpointPublic}
keystone user-create --name ${cfg.serviceUsername} --tenant service --pass ${getSecret cfg.servicePassword}
keystone user-role-add --tenant service --user ${cfg.serviceUsername} --role admin
fi
'';
serviceConfig = {
PermissionsStartOnly = true; # preStart must be run as root
TimeoutStartSec = "600"; # 10min for initial db migrations
User = "glance";
Group = "glance";
ExecStart = "${cfg.package}/bin/glance-registry --config-file=${glanceRegistryConf}";
};
};
systemd.services.glance-api = {
description = "OpenStack Glance API Daemon";
after = [ "glance-registry.service" "network.target"];
requires = [ "glance-registry.service" "network.target"];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
PermissionsStartOnly = true; # preStart must be run as root
User = "glance";
Group = "glance";
ExecStart = "${cfg.package}/bin/glance-api --config-file=${glanceApiConf}";
};
};
};
}

View File

@ -1,220 +0,0 @@
{ config, lib, pkgs, ... }:
with lib; with import ./common.nix {inherit lib;};
let
cfg = config.virtualisation.openstack.keystone;
keystoneConfTpl = pkgs.writeText "keystone.conf" ''
[DEFAULT]
admin_token = ${cfg.adminToken.pattern}
policy_file=${cfg.package}/etc/policy.json
[database]
connection = "mysql://${cfg.database.user}:${cfg.database.password.pattern}@${cfg.database.host}/${cfg.database.name}"
[paste_deploy]
config_file = ${cfg.package}/etc/keystone-paste.ini
${cfg.extraConfig}
'';
keystoneConf = "/var/lib/keystone/keystone.conf";
in {
options.virtualisation.openstack.keystone = {
package = mkOption {
type = types.package;
example = literalExample "pkgs.keystone";
description = ''
Keystone package to use.
'';
};
enable = mkOption {
default = false;
type = types.bool;
description = ''
Enable Keystone, the OpenStack Identity Service
'';
};
extraConfig = mkOption {
default = "";
type = types.lines;
description = ''
Additional text appended to <filename>keystone.conf</filename>,
the main Keystone configuration file.
'';
};
adminToken = mkSecretOption {
name = "adminToken";
description = ''
This is the admin token used to boostrap keystone,
ie. to provision first resources.
'';
};
bootstrap = {
enable = mkOption {
default = false;
type = types.bool;
description = ''
Bootstrap the Keystone service by creating the service
tenant, an admin account and a public endpoint. This options
provides a ready-to-use admin account. This is only done at
the first Keystone execution by the systemd post start.
Note this option is a helper for setting up development or
testing environments.
'';
};
endpointPublic = mkOption {
type = types.str;
default = "http://localhost:5000/v2.0";
description = ''
The public identity endpoint. The link <link
xlink:href="http://docs.openstack.org/liberty/install-guide-rdo/keystone-services.html">
create keystone endpoint</link> provides more informations
about that.
'';
};
adminUsername = mkOption {
type = types.str;
default = "admin";
description = ''
A keystone admin username.
'';
};
adminPassword = mkSecretOption {
name = "keystoneAdminPassword";
description = ''
The keystone admin user's password.
'';
};
adminTenant = mkOption {
type = types.str;
default = "admin";
description = ''
A keystone admin tenant name.
'';
};
};
database = {
host = mkOption {
type = types.str;
default = "localhost";
description = ''
Host of the database.
'';
};
name = mkOption {
type = types.str;
default = "keystone";
description = ''
Name of the existing database.
'';
};
user = mkOption {
type = types.str;
default = "keystone";
description = ''
The database user. The user must exist and has access to
the specified database.
'';
};
password = mkSecretOption {
name = "mysqlPassword";
description = "The database user's password";};
};
};
config = mkIf cfg.enable {
# Note: when changing the default, make it conditional on
# system.stateVersion to maintain compatibility with existing
# systems!
virtualisation.openstack.keystone.package = mkDefault pkgs.keystone;
users.extraUsers = [{
name = "keystone";
group = "keystone";
uid = config.ids.uids.keystone;
}];
users.extraGroups = [{
name = "keystone";
gid = config.ids.gids.keystone;
}];
systemd.services.keystone-all = {
description = "OpenStack Keystone Daemon";
after = [ "network.target"];
path = [ cfg.package pkgs.mysql pkgs.curl pkgs.pythonPackages.keystoneclient pkgs.gawk ];
wantedBy = [ "multi-user.target" ];
preStart = ''
mkdir -m 755 -p /var/lib/keystone
cp ${keystoneConfTpl} ${keystoneConf};
chown keystone:keystone ${keystoneConf};
chmod 640 ${keystoneConf}
${replaceSecret cfg.database.password keystoneConf}
${replaceSecret cfg.adminToken keystoneConf}
# Initialise the database
${cfg.package}/bin/keystone-manage --config-file=${keystoneConf} db_sync
# Set up the keystone's PKI infrastructure
${cfg.package}/bin/keystone-manage --config-file=${keystoneConf} pki_setup --keystone-user keystone --keystone-group keystone
'';
postStart = optionalString cfg.bootstrap.enable ''
set -eu
# Wait until the keystone is available for use
count=0
while ! curl --fail -s http://localhost:35357/v2.0 > /dev/null
do
if [ $count -eq 30 ]
then
echo "Tried 30 times, giving up..."
exit 1
fi
echo "Keystone not yet started. Waiting for 1 second..."
count=$((count++))
sleep 1
done
# We use the service token to create a first admin user
export OS_SERVICE_ENDPOINT=http://localhost:35357/v2.0
export OS_SERVICE_TOKEN=${getSecret cfg.adminToken}
# If the tenant service doesn't exist, we consider
# keystone is not initialized
if ! keystone tenant-get service
then
keystone tenant-create --name service
keystone tenant-create --name ${cfg.bootstrap.adminTenant}
keystone user-create --name ${cfg.bootstrap.adminUsername} --tenant ${cfg.bootstrap.adminTenant} --pass ${getSecret cfg.bootstrap.adminPassword}
keystone role-create --name admin
keystone role-create --name Member
keystone user-role-add --tenant ${cfg.bootstrap.adminTenant} --user ${cfg.bootstrap.adminUsername} --role admin
keystone service-create --type identity --name keystone
ID=$(keystone service-get keystone | awk '/ id / { print $4 }')
keystone endpoint-create --region RegionOne --service $ID --publicurl ${cfg.bootstrap.endpointPublic} --adminurl http://localhost:35357/v2.0 --internalurl http://localhost:5000/v2.0
fi
'';
serviceConfig = {
PermissionsStartOnly = true; # preStart must be run as root
TimeoutStartSec = "600"; # 10min for initial db migrations
User = "keystone";
Group = "keystone";
ExecStart = "${cfg.package}/bin/keystone-all --config-file=${keystoneConf}";
};
};
};
}

View File

@ -267,7 +267,6 @@ in rec {
tests.fleet = hydraJob (import tests/fleet.nix { system = "x86_64-linux"; });
#tests.gitlab = callTest tests/gitlab.nix {};
tests.gitolite = callTest tests/gitolite.nix {};
tests.glance = callTest tests/glance.nix {};
tests.gocd-agent = callTest tests/gocd-agent.nix {};
tests.gocd-server = callTest tests/gocd-server.nix {};
tests.gnome3 = callTest tests/gnome3.nix {};
@ -293,7 +292,6 @@ in rec {
tests.kernel-copperhead = callTest tests/kernel-copperhead.nix {};
tests.kernel-latest = callTest tests/kernel-latest.nix {};
tests.kernel-lts = callTest tests/kernel-lts.nix {};
tests.keystone = callTest tests/keystone.nix {};
tests.kubernetes = hydraJob (import tests/kubernetes/default.nix { system = "x86_64-linux"; });
tests.latestKernel.login = callTest tests/login.nix { latestKernel = true; };
tests.ldap = callTest tests/ldap.nix {};

View File

@ -1,77 +0,0 @@
{ system ? builtins.currentSystem }:
with import ../lib/testing.nix { inherit system; };
with pkgs.lib;
let
glanceMysqlPassword = "glanceMysqlPassword";
glanceAdminPassword = "glanceAdminPassword";
createDb = pkgs.writeText "db-provisionning.sql" ''
create database keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'keystone';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'keystone';
create database glance;
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY '${glanceMysqlPassword}';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY '${glanceMysqlPassword}';
'';
image =
(import ../lib/eval-config.nix {
inherit system;
modules = [ ../../nixos/modules/virtualisation/nova-image.nix ];
}).config.system.build.novaImage;
# The admin keystone account
adminOpenstackCmd = "OS_TENANT_NAME=admin OS_USERNAME=admin OS_PASSWORD=keystone OS_AUTH_URL=http://localhost:5000/v3 OS_IDENTITY_API_VERSION=3 openstack";
in makeTest {
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ lewo ];
};
machine =
{ config, pkgs, ... }:
{
services.mysql.enable = true;
services.mysql.package = pkgs.mysql;
services.mysql.initialScript = createDb;
virtualisation = {
openstack.keystone = {
enable = true;
database.password = { value = "keystone"; storage = "fromNixStore"; };
adminToken = { value = "adminToken"; storage = "fromNixStore"; };
bootstrap.enable = true;
bootstrap.adminPassword = { value = "keystone"; storage = "fromNixStore"; };
};
openstack.glance = {
enable = true;
database.password = { value = glanceMysqlPassword; storage = "fromNixStore"; };
servicePassword = { value = glanceAdminPassword; storage = "fromNixStore"; };
bootstrap = {
enable = true;
keystoneAdminPassword = { value = "keystone"; storage = "fromNixStore"; };
};
};
memorySize = 2096;
diskSize = 4 * 1024;
};
environment.systemPackages = with pkgs.pythonPackages; with pkgs; [
openstackclient
];
};
testScript =
''
$machine->waitForUnit("glance-api.service");
# Since Glance api can take time to start, we retry until success
$machine->waitUntilSucceeds("${adminOpenstackCmd} image create nixos --file ${image}/nixos.img --disk-format qcow2 --container-format bare --public");
$machine->succeed("${adminOpenstackCmd} image list") =~ /nixos/ or die;
'';
}

View File

@ -1,82 +0,0 @@
{ system ? builtins.currentSystem }:
with import ../lib/testing.nix { inherit system; };
with pkgs.lib;
let
keystoneMysqlPassword = "keystoneMysqlPassword";
keystoneMysqlPasswordFile = "/var/run/keystoneMysqlPassword";
keystoneAdminPassword = "keystoneAdminPassword";
createKeystoneDb = pkgs.writeText "create-keystone-db.sql" ''
create database keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY '${keystoneMysqlPassword}';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY '${keystoneMysqlPassword}';
'';
# The admin keystone account
adminOpenstackCmd = "OS_TENANT_NAME=admin OS_USERNAME=admin OS_PASSWORD=${keystoneAdminPassword} OS_AUTH_URL=http://localhost:5000/v3 OS_IDENTITY_API_VERSION=3 openstack";
# The created demo keystone account
demoOpenstackCmd = "OS_TENANT_NAME=demo OS_USERNAME=demo OS_PASSWORD=demo OS_AUTH_URL=http://localhost:5000/v3 OS_IDENTITY_API_VERSION=3 openstack";
in makeTest {
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ lewo ];
};
machine =
{ config, pkgs, ... }:
{
# This is to simulate nixops deployment process.
# https://nixos.org/nixops/manual/#opt-deployment.keys
boot.postBootCommands = "echo ${keystoneMysqlPassword} > ${keystoneMysqlPasswordFile}";
services.mysql.enable = true;
services.mysql.initialScript = createKeystoneDb;
virtualisation = {
openstack.keystone = {
enable = true;
# Check if we can get the secret from a file
database.password = {
value = keystoneMysqlPasswordFile;
storage = "fromFile";
};
adminToken = {
value = "adminToken";
storage = "fromNixStore";
};
bootstrap.enable = true;
# Check if we can get the secret from the store
bootstrap.adminPassword = {
value = keystoneAdminPassword;
storage = "fromNixStore";
};
};
memorySize = 2096;
diskSize = 4 * 1024;
};
environment.systemPackages = with pkgs.pythonPackages; with pkgs; [
openstackclient
];
};
testScript =
''
$machine->waitForUnit("keystone-all.service");
# Verify that admin ccount is working
$machine->succeed("${adminOpenstackCmd} token issue");
# Try to create a new user
$machine->succeed("${adminOpenstackCmd} project create --domain default --description 'Demo Project' demo");
$machine->succeed("${adminOpenstackCmd} user create --domain default --password demo demo");
$machine->succeed("${adminOpenstackCmd} role create user");
$machine->succeed("${adminOpenstackCmd} role add --project demo --user demo user");
# Verify this new account is working
$machine->succeed("${demoOpenstackCmd} token issue");
'';
}

View File

@ -1,69 +0,0 @@
{ stdenv, fetchurl, python2Packages, sqlite, which, strace }:
python2Packages.buildPythonApplication rec {
name = "glance-${version}";
version = "11.0.0";
namePrefix = "";
PBR_VERSION = "${version}";
src = fetchurl {
url = "https://github.com/openstack/glance/archive/${version}.tar.gz";
sha256 = "05rz1lmzdmpnw8sf87vvi0l6q9g6s840z934zyinw17yfcvmqrdg";
};
# https://github.com/openstack/glance/blob/stable/liberty/requirements.txt
propagatedBuildInputs = with python2Packages; [
pbr sqlalchemy anyjson eventlet PasteDeploy routes webob sqlalchemy_migrate
httplib2 pycrypto iso8601 stevedore futurist keystonemiddleware paste
jsonschema keystoneclient pyopenssl six retrying semantic-version qpid-python
WSME osprofiler glance_store castellan taskflow cryptography xattr pysendfile
# oslo componenets
oslo-config oslo-context oslo-concurrency oslo-service oslo-utils oslo-db
oslo-i18n oslo-log oslo-messaging oslo-middleware oslo-policy oslo-serialization
MySQL_python
];
buildInputs = with python2Packages; [
Babel coverage fixtures mox3 mock oslosphinx requests testrepository pep8
testresources testscenarios testtools psutil_1 oslotest psycopg2
sqlite which strace
];
patchPhase = ''
# it's not a test, but a class mixin
sed -i 's/ImageCacheTestCase/ImageCacheMixin/' glance/tests/unit/test_image_cache.py
# these require network access, see https://bugs.launchpad.net/glance/+bug/1508868
sed -i 's/test_get_image_data_http/noop/' glance/tests/unit/common/scripts/test_scripts_utils.py
sed -i 's/test_set_image_data_http/noop/' glance/tests/unit/common/scripts/image_import/test_main.py
sed -i 's/test_create_image_with_nonexistent_location_url/noop/' glance/tests/unit/v1/test_api.py
sed -i 's/test_upload_image_http_nonexistent_location_url/noop/' glance/tests/unit/v1/test_api.py
# TODO: couldn't figure out why this test is failing
sed -i 's/test_all_task_api/noop/' glance/tests/integration/v2/test_tasks_api.py
'';
postInstall = ''
# check all binaries don't crash
for i in $out/bin/*; do
case "$i" in
*glance-artifacts) # https://bugs.launchpad.net/glance/+bug/1508879
:
;;
*)
$i --help
esac
done
cp etc/*-paste.ini $out/etc/
'';
meta = with stdenv.lib; {
homepage = http://glance.openstack.org/;
description = "Services for discovering, registering, and retrieving virtual machine images";
license = stdenv.lib.licenses.asl20;
platforms = stdenv.lib.platforms.linux;
};
}

View File

@ -1,55 +0,0 @@
{ stdenv, fetchurl, python2Packages, xmlsec, which, openssl }:
python2Packages.buildPythonApplication rec {
name = "keystone-${version}";
version = "8.0.0";
namePrefix = "";
PBR_VERSION = "${version}";
src = fetchurl {
url = "https://github.com/openstack/keystone/archive/${version}.tar.gz";
sha256 = "1xbrs7xgwjzrs07zyxxcl2lq18dh582gd6lx1zzzji8c0qmffy0z";
};
# remove on next version bump
patches = [ ./remove-oslo-policy-tests.patch ];
# https://github.com/openstack/keystone/blob/stable/liberty/requirements.txt
propagatedBuildInputs = with python2Packages; [
pbr webob eventlet greenlet PasteDeploy paste routes cryptography six
sqlalchemy sqlalchemy_migrate stevedore passlib keystoneclient memcached
keystonemiddleware oauthlib pysaml2 dogpile_cache jsonschema pycadf msgpack
xmlsec MySQL_python
# oslo
oslo-cache oslo-concurrency oslo-config oslo-context oslo-messaging oslo-db
oslo-i18n oslo-log oslo-middleware oslo-policy oslo-serialization oslo-service
oslo-utils
];
buildInputs = with python2Packages; [
coverage fixtures mock subunit tempest-lib testtools testrepository
ldap ldappool webtest requests oslotest pep8 pymongo which
];
makeWrapperArgs = ["--prefix PATH : '${openssl.bin}/bin:$PATH'"];
postInstall = ''
# install .ini files
mkdir -p $out/etc
cp etc/* $out/etc
# check all binaries don't crash
for i in $out/bin/*; do
$i --help
done
'';
meta = with stdenv.lib; {
homepage = http://keystone.openstack.org/;
description = "Authentication, authorization and service discovery mechanisms via HTTP";
license = stdenv.lib.licenses.asl20;
platforms = stdenv.lib.platforms.linux;
};
}

View File

@ -1,93 +0,0 @@
From 3aefdf4de76fdcdc02093bc631e339f9ecd4c707 Mon Sep 17 00:00:00 2001
From: James Page <james.page@ubuntu.com>
Date: Fri, 18 Sep 2015 16:38:47 +0100
Subject: Add compatibility with iproute2 >= 4.0
The ip netns list command adds additional id data in more recent
versions of iproute2 of the format:
qdhcp-35fc068a-750d-4add-b1d2-af392dbd8790 (id: 1)
Update parsing to deal with old and new formats.
Change-Id: I0d3fc4262284172f5ad31e4f2f78ae1fb33b4228
Closes-Bug: 1497309
---
neutron/agent/linux/ip_lib.py | 6 +++---
neutron/tests/functional/agent/test_l3_agent.py | 2 +-
neutron/tests/unit/agent/linux/test_ip_lib.py | 15 +++++++++++++++
3 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/neutron/agent/linux/ip_lib.py b/neutron/agent/linux/ip_lib.py
index 551341a..a717bf6 100644
--- a/neutron/agent/linux/ip_lib.py
+++ b/neutron/agent/linux/ip_lib.py
@@ -208,7 +208,7 @@ class IPWrapper(SubProcessBase):
@classmethod
def get_namespaces(cls):
output = cls._execute([], 'netns', ('list',))
- return [l.strip() for l in output.split('\n')]
+ return [l.split()[0] for l in output.splitlines()]
class IPDevice(SubProcessBase):
@@ -819,8 +819,8 @@ class IpNetnsCommand(IpCommandBase):
output = self._parent._execute(
['o'], 'netns', ['list'],
run_as_root=cfg.CONF.AGENT.use_helper_for_ns_read)
- for line in output.split('\n'):
- if name == line.strip():
+ for line in [l.split()[0] for l in output.splitlines()]:
+ if name == line:
return True
return False
diff --git a/neutron/tests/functional/agent/test_l3_agent.py b/neutron/tests/functional/agent/test_l3_agent.py
index ffa20e6..84b16df 100644
--- a/neutron/tests/functional/agent/test_l3_agent.py
+++ b/neutron/tests/functional/agent/test_l3_agent.py
@@ -790,7 +790,7 @@ class L3HATestFramework(L3AgentTestFramework):
get_ns_name = mock.patch.object(
namespaces.RouterNamespace, '_get_ns_name').start()
get_ns_name.return_value = "%s%s%s" % (
- namespaces.RouterNamespace._get_ns_name(router_info['id']),
+ 'qrouter-' + router_info['id'],
self.NESTED_NAMESPACE_SEPARATOR, self.agent.host)
router1 = self.manage_router(self.agent, router_info)
diff --git a/neutron/tests/unit/agent/linux/test_ip_lib.py b/neutron/tests/unit/agent/linux/test_ip_lib.py
index 2de408d..bdfc9d7 100644
--- a/neutron/tests/unit/agent/linux/test_ip_lib.py
+++ b/neutron/tests/unit/agent/linux/test_ip_lib.py
@@ -27,6 +27,11 @@ NETNS_SAMPLE = [
'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb',
'cccccccc-cccc-cccc-cccc-cccccccccccc']
+NETNS_SAMPLE_IPROUTE2_4 = [
+ '12345678-1234-5678-abcd-1234567890ab (id: 1)',
+ 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb (id: 0)',
+ 'cccccccc-cccc-cccc-cccc-cccccccccccc (id: 2)']
+
LINK_SAMPLE = [
'1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN \\'
'link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 promiscuity 0',
@@ -279,6 +284,16 @@ class TestIpWrapper(base.BaseTestCase):
self.execute.assert_called_once_with([], 'netns', ('list',))
+ def test_get_namespaces_iproute2_4(self):
+ self.execute.return_value = '\n'.join(NETNS_SAMPLE_IPROUTE2_4)
+ retval = ip_lib.IPWrapper.get_namespaces()
+ self.assertEqual(retval,
+ ['12345678-1234-5678-abcd-1234567890ab',
+ 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb',
+ 'cccccccc-cccc-cccc-cccc-cccccccccccc'])
+
+ self.execute.assert_called_once_with([], 'netns', ('list',))
+
def test_add_tuntap(self):
ip_lib.IPWrapper().add_tuntap('tap0')
self.execute.assert_called_once_with([], 'tuntap',
--
cgit v0.11.2

View File

@ -1,69 +0,0 @@
{ stdenv, fetchurl, python2Packages, xmlsec, which, dnsmasq }:
python2Packages.buildPythonApplication rec {
name = "neutron-${version}";
version = "7.0.0";
namePrefix = "";
PBR_VERSION = "${version}";
src = fetchurl {
url = "https://github.com/openstack/neutron/archive/${version}.tar.gz";
sha256 = "02ll081xly7zfjmgkal81fy3aplbnn5zgx8xfy3yy1nv3kfnyi40";
};
# https://github.com/openstack/neutron/blob/stable/liberty/requirements.txt
propagatedBuildInputs = with python2Packages; [
pbr paste PasteDeploy routes debtcollector eventlet greenlet httplib2 requests
jinja2 keystonemiddleware netaddr retrying sqlalchemy webob alembic six
stevedore pecan ryu networking-hyperv MySQL_python
# clients
keystoneclient neutronclient novaclient
# oslo components
oslo-concurrency oslo-config oslo-context oslo-db oslo-i18n oslo-log oslo-messaging
oslo-middleware oslo-policy oslo-rootwrap oslo-serialization oslo-service oslo-utils
oslo-versionedobjects
];
# make sure we include migrations
prePatch = ''
echo "graft neutron" >> MANIFEST.in
substituteInPlace etc/neutron/rootwrap.d/dhcp.filters --replace "/sbin/dnsmasq" "${dnsmasq}/bin/dnsmasq"
'';
patches = [ ./neutron-iproute-4.patch ];
buildInputs = with python2Packages; [
cliff coverage fixtures mock subunit requests-mock oslosphinx testrepository
testtools testresources testscenarios webtest oslotest os-testr tempest-lib
ddt pep8
];
postInstall = ''
# requires extra optional dependencies
# TODO: package networking_mlnx, networking_vsphere, bsnstacklib, XenAPI
rm $out/bin/{neutron-mlnx-agent,neutron-ovsvapp-agent,neutron-restproxy-agent,neutron-rootwrap-xen-dom0}
# check all binaries don't crash
for i in $out/bin/*; do
case "$i" in
*neutron-pd-notify|*neutron-rootwrap-daemon|*neutron-rootwrap)
:
;;
*)
$i --help
esac
done
'';
meta = with stdenv.lib; {
homepage = http://neutron.openstack.org/;
description = "Virtual network service for Openstack";
license = stdenv.lib.licenses.asl20;
platforms = stdenv.lib.platforms.linux;
# Marked as broken due to needing an update for security issues.
# See: https://github.com/NixOS/nixpkgs/issues/18856
broken = true;
};
}

View File

@ -1,71 +0,0 @@
{ stdenv, fetchurl, python2Packages, openssl, openssh }:
python2Packages.buildPythonApplication rec {
name = "nova-${version}";
version = "12.0.0";
namePrefix = "";
PBR_VERSION = "${version}";
src = fetchurl {
url = "https://github.com/openstack/nova/archive/${version}.tar.gz";
sha256 = "175n1znvmy8f5vqvabc2fa4qy8y17685z4gzpq8984mdsdnpv21w";
};
# otherwise migrate.cfg is not installed
patchPhase = ''
echo "graft nova" >> MANIFEST.in
# remove transient error test, see http://hydra.nixos.org/build/40203534
rm nova/tests/unit/compute/test_{shelve,compute_utils}.py
'';
# https://github.com/openstack/nova/blob/stable/liberty/requirements.txt
propagatedBuildInputs = with python2Packages; [
pbr sqlalchemy boto decorator eventlet jinja2 lxml routes cryptography
webob greenlet PasteDeploy paste prettytable sqlalchemy_migrate netaddr
netifaces paramiko Babel iso8601 jsonschema keystoneclient requests six
stevedore websockify rfc3986 os-brick psutil_1 alembic psycopg2 pymysql
keystonemiddleware MySQL_python
# oslo components
oslo-rootwrap oslo-reports oslo-utils oslo-i18n oslo-config oslo-context
oslo-log oslo-serialization oslo-middleware oslo-db oslo-service oslo-messaging
oslo-concurrency oslo-versionedobjects
# clients
cinderclient neutronclient glanceclient
];
buildInputs = with python2Packages; [
coverage fixtures mock mox3 subunit requests-mock pillow oslosphinx
oslotest testrepository testresources testtools tempest-lib bandit
oslo-vmware pep8 barbicanclient ironicclient openssl openssh
];
postInstall = ''
cp -prvd etc $out/etc
# check all binaries don't crash
for i in $out/bin/*; do
case "$i" in
*nova-dhcpbridge*)
:
;;
*nova-rootwrap*)
:
;;
*)
$i --help
;;
esac
done
'';
meta = with stdenv.lib; {
homepage = http://nova.openstack.org/;
description = "OpenStack Compute (a.k.a. Nova), a cloud computing fabric controller";
license = stdenv.lib.licenses.asl20;
platforms = stdenv.lib.platforms.linux;
};
}

View File

@ -1,61 +0,0 @@
From 6016d017004acaae288312b196ef07ea98e9962d Mon Sep 17 00:00:00 2001
From: Brant Knudson <bknudson@us.ibm.com>
Date: Mon, 12 Oct 2015 15:12:45 -0500
Subject: [PATCH] Remove oslo.policy implementation tests from keystone
oslo.policy 0.12.0 contains a change to use requests to do the http
check rather than urllib. This change caused keystone tests to fail
because the keystone tests were mocking urllib, making assumptions
about how oslo.policy is implemented. Keystone doesn't need to test
internal features of oslo.policy, so these tests are removed.
Change-Id: I9d6e4950b9fe75cbb94100c8effdcec002642027
Closes-Bug: 1505374
---
keystone/tests/unit/test_policy.py | 24 ------------------------
1 file changed, 24 deletions(-)
diff --git a/keystone/tests/unit/test_policy.py b/keystone/tests/unit/test_policy.py
index b2f0e52..686e2b7 100644
--- a/keystone/tests/unit/test_policy.py
+++ b/keystone/tests/unit/test_policy.py
@@ -16,10 +16,8 @@
import json
import os
-import mock
from oslo_policy import policy as common_policy
import six
-from six.moves.urllib import request as urlrequest
from testtools import matchers
from keystone import exception
@@ -118,28 +116,6 @@ def test_enforce_good_action(self):
action = "example:allowed"
rules.enforce(self.credentials, action, self.target)
- def test_enforce_http_true(self):
-
- def fakeurlopen(url, post_data):
- return six.StringIO("True")
-
- action = "example:get_http"
- target = {}
- with mock.patch.object(urlrequest, 'urlopen', fakeurlopen):
- result = rules.enforce(self.credentials, action, target)
- self.assertTrue(result)
-
- def test_enforce_http_false(self):
-
- def fakeurlopen(url, post_data):
- return six.StringIO("False")
-
- action = "example:get_http"
- target = {}
- with mock.patch.object(urlrequest, 'urlopen', fakeurlopen):
- self.assertRaises(exception.ForbiddenAction, rules.enforce,
- self.credentials, action, target)
-
def test_templatized_enforcement(self):
target_mine = {'project_id': 'fake'}
target_not_mine = {'project_id': 'another'}

View File

@ -1,26 +0,0 @@
From f37947a7e083532676a9f2ed079dff6bdc19a8e9 Mon Sep 17 00:00:00 2001
From: Sabari Kumar Murugesan <smurugesan@vmware.com>
Date: Tue, 15 Sep 2015 14:22:11 -0700
Subject: [PATCH] Fix swift store tests for latest swiftclient
The latest swiftclient (2.6.0) breaks some of the swift store
tests as a mock function's parameters got changed.
Change-Id: I36512fbe642f4f12cf1382fdf0e37eccbf1acba4
---
glance_store/tests/unit/test_swift_store.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/glance_store/tests/unit/test_swift_store.py b/glance_store/tests/unit/test_swift_store.py
index f738cf9..3fe4699 100644
--- a/glance_store/tests/unit/test_swift_store.py
+++ b/glance_store/tests/unit/test_swift_store.py
@@ -92,7 +92,7 @@ def fake_head_container(url, token, container, **kwargs):
def fake_put_container(url, token, container, **kwargs):
fixture_containers.append(container)
- def fake_post_container(url, token, container, headers, http_conn=None):
+ def fake_post_container(url, token, container, headers, **kwargs):
for key, value in six.iteritems(headers):
fixture_container_headers[key] = value

View File

@ -1,37 +0,0 @@
{ buildPythonPackage, isPyPy, fetchPypi, python
, pbr, testtools, testresources, testrepository, mock
, pep8, fixtures, mox3, requests-mock
, iso8601, requests, six, stevedore, webob, oslo-config
, pyyaml, betamax, oauthlib
}:
buildPythonPackage rec {
pname = "keystoneauth1";
version = "3.2.0";
name = "${pname}-${version}";
disabled = isPyPy; # a test fails
src = fetchPypi {
inherit pname version;
sha256 = "0rg3harfyvai34lrjiqnl1crmvswjvj8nsviasnz4b9pcvp3d03n";
};
buildInputs = [ pbr ];
checkInputs = [ pyyaml betamax oauthlib testtools testresources
testrepository mock pep8 fixtures mox3 requests-mock ];
propagatedBuildInputs = [ iso8601 requests six stevedore webob ];
doCheck = true;
# 1. oslo-config
# 2. oslo-utils
# 3. requests-kerberos
preCheck = ''
rm keystoneauth1/tests/unit/loading/test_{session,conf,adapter}.py
rm keystoneauth1/tests/unit/access/test_v{2,3}_access.py
rm keystoneauth1/tests/unit/extras/kerberos/test_fedkerb_loading.py
'';
postPatch = ''
sed -i 's@python@${python.interpreter}@' .testr.conf
substituteInPlace requirements.txt --replace "argparse" ""
'';
}

View File

@ -1,53 +0,0 @@
{ stdenv, buildPythonPackage, fetchFromGitHub, python
, pbr, testtools, testresources, testrepository
, requests-mock, fixtures, openssl, oslotest, pep8
, oslo-serialization, oslo-config, oslo-i18n, oslo-utils
, Babel, prettytable, requests, six, iso8601, stevedore
, netaddr, debtcollector, bandit, webob, mock, pycrypto
}:
buildPythonPackage rec {
pname = "keystoneclient";
version = "1.8.1";
name = pname + "-" + version;
src = fetchFromGitHub {
owner = "openstack";
repo = "python-keystoneclient";
rev = version;
sha256 = "0yayn1hb3mncqb0isy8vy6d519xya7mhf5pcbn60fzdqjrkj2prq";
};
PBR_VERSION = "${version}";
buildInputs = [
pbr testtools testresources testrepository requests-mock fixtures openssl
oslotest pep8
];
propagatedBuildInputs = [
oslo-serialization oslo-config oslo-i18n oslo-utils
Babel prettytable requests six iso8601 stevedore
netaddr debtcollector bandit webob mock pycrypto
];
postPatch = ''
sed -i 's@python@${python.interpreter}@' .testr.conf
sed -ie '/argparse/d' requirements.txt
'';
doCheck = false; # The checkPhase below is broken
checkPhase = ''
patchShebangs run_tests.sh
./run_tests.sh
'';
meta = with stdenv.lib; {
homepage = https://github.com/openstack/python-novaclient/;
description = "Client library and command line tool for the OpenStack Nova API";
license = licenses.asl20;
platforms = platforms.linux;
};
}

View File

@ -1,33 +0,0 @@
{ stdenv, buildPythonPackage, fetchPypi, python,
pbr, Babel, testrepository, subunit, testtools,
coverage, oslosphinx, oslotest, testscenarios, six, ddt
}:
buildPythonPackage rec {
version = "0.8.2";
pname = "os-testr";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "d8a60bd56c541714a5cab4d1996c8ddfdb5c7c35393d55be617803048c170837";
};
patchPhase = ''
sed -i 's@python@${python.interpreter}@' .testr.conf
sed -i 's@python@${python.interpreter}@' os_testr/tests/files/testr-conf
'';
checkPhase = ''
export PATH=$PATH:$out/bin
${python.interpreter} setup.py test
'';
propagatedBuildInputs = [ pbr Babel testrepository subunit testtools ];
buildInputs = [ coverage oslosphinx oslotest testscenarios six ddt ];
meta = with stdenv.lib; {
description = "A testr wrapper to provide functionality for OpenStack projects";
homepage = http://docs.openstack.org/developer/os-testr/;
license = licenses.asl20;
};
}

View File

@ -1,32 +0,0 @@
{ lib, buildPythonPackage, fetchPypi, pbr, six, netaddr, stevedore, mock,
debtcollector, rfc3986, pyyaml, oslo-i18n }:
buildPythonPackage rec {
pname = "oslo.config";
version = "4.13.2";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "882e5f1dcc0e5b0d7af877b2df0e2692113c5975db8cbbbf0dd3d2b905aefc0b";
};
propagatedBuildInputs = [ pbr six netaddr stevedore debtcollector rfc3986 pyyaml oslo-i18n ];
buildInputs = [ mock ];
# TODO: circular import on oslo-i18n
doCheck = false;
postPatch = ''
substituteInPlace requirements.txt --replace "argparse" ""
'';
meta = with lib; {
description = "Oslo Configuration API";
homepage = "https://docs.openstack.org/oslo.config/latest/";
license = licenses.asl20;
maintainers = with maintainers; [ makefu ];
};
}

View File

@ -1,35 +0,0 @@
{ lib, buildPythonPackage, fetchurl, requests, novaclient, keyring,
rackspace-novaclient, six, isPy3k, pytest, glibcLocales }:
buildPythonPackage rec {
pname = "pyrax";
version = "1.9.8";
name = "${pname}-${version}";
src = fetchurl {
url = "mirror://pypi/p/pyrax/${name}.tar.gz";
sha256 = "1x98jzyxnvha81pgx3jpfixljhs7zik89yfp8q06kwpx8ws99nz9";
};
# no good reason given in commit why limited, and seems to work
patchPhase = ''
substituteInPlace "setup.py" \
--replace "python-novaclient==2.27.0" "python-novaclient"
'';
disabled = isPy3k;
propagatedBuildInputs = [ requests novaclient keyring rackspace-novaclient six ];
LC_ALL = "en_US.UTF-8";
buildInputs = [ pytest glibcLocales ];
checkPhase = ''
py.test tests/unit
'';
meta = {
homepage = https://github.com/rackspace/pyrax;
license = lib.licenses.asl20;
description = "Python API to interface with Rackspace";
maintainers = with lib.maintainers; [ teh ];
};
}

View File

@ -1,166 +0,0 @@
{ buildPythonPackage, fetchurl, isPy3k, requests, novaclient, six, lib }:
let
os-virtual-interfacesv2-python-novaclient-ext = buildPythonPackage rec {
pname = "os_virtual_interfacesv2_python_novaclient_ext";
version = "0.20";
name = pname + "-" + version;
src = fetchurl {
url = "mirror://pypi/o/os-virtual-interfacesv2-python-novaclient-ext/${name}.tar.gz";
sha256 = "17a4r8psxmfikgmzh709absbn5jsh1005whibmwhysj9fi0zyfbd";
};
propagatedBuildInputs = [ six novaclient ];
meta = {
homepage = https://github.com/rackerlabs/os_virtual_interfacesv2_ext;
license = lib.licenses.asl20;
description = "Adds Virtual Interfaces support to python-novaclient";
};
};
ip-associations-python-novaclient-ext = buildPythonPackage rec {
pname = "ip_associations_python_novaclient_ext";
version = "0.2";
name = pname + "-" + version;
src = fetchurl {
url = "mirror://pypi/i/ip_associations_python_novaclient_ext/${name}.tar.gz";
sha256 = "0dxfkfjhzskafmb01y8hzbcpvc4cd6fas1s50dzcmg29w4z6qmz4";
};
propagatedBuildInputs = [ six novaclient ];
meta = {
homepage = https://github.com/rackerlabs/ip_associations_python_novaclient_ext;
license = lib.licenses.asl20;
description = "Adds Rackspace ip_associations support to python-novaclient";
};
};
rackspace-auth-openstack = buildPythonPackage rec {
pname = "rackspace-auth-openstack";
version = "1.3";
name = pname + "-" + version;
src = fetchurl {
url = "mirror://pypi/r/rackspace-auth-openstack/${name}.tar.gz";
sha256 = "1kaiyvgwmavw2mh0s32yjk70xsziynjdhi01qn9a8kljn7p6kh64";
};
propagatedBuildInputs = [ six novaclient ];
meta = {
homepage = https://pypi.python.org/pypi/rackspace-auth-openstack;
license = lib.licenses.asl20;
description = "Rackspace Auth Plugin for OpenStack Clients.";
};
};
rax-default-network-flags-python-novaclient-ext = buildPythonPackage rec {
pname = "rax_default_network_flags_python_novaclient_ext";
version = "0.4.0";
name = pname + "-" + version;
src = fetchurl {
url = "mirror://pypi/r/rax_default_network_flags_python_novaclient_ext/${name}.tar.gz";
sha256 = "00b0csb58k6rr1is68bkkw358mms8mmb898bm8bbr8g7j2fz8aw5";
};
propagatedBuildInputs = [ six novaclient ];
meta = {
homepage = https://pypi.python.org/simple/rax-default-network-flags-python-novaclient-ext;
license = lib.licenses.asl20;
description = "Novaclient Extension for Instance Default Network Flags";
};
};
os-networksv2-python-novaclient-ext = buildPythonPackage rec {
pname = "os_networksv2_python_novaclient_ext";
version = "0.26";
name = pname + "-" + version;
src = fetchurl {
url = "mirror://pypi/o/os_networksv2_python_novaclient_ext/${name}.tar.gz";
sha256 = "06dzqmyrwlq7hla6dk699z18c8v27qr1gxqknimwxlwqdlhpafk1";
};
propagatedBuildInputs = [ six novaclient ];
meta = {
homepage = https://pypi.python.org/pypi/os_networksv2_python_novaclient_ext;
license = lib.licenses.asl20;
description = "Adds rackspace networks support to python-novaclient";
};
};
rax-scheduled-images-python-novaclient-ext = buildPythonPackage rec {
pname = "rax_scheduled_images_python_novaclient_ext";
version = "0.3.1";
name = pname + "-" + version;
src = fetchurl {
url = "mirror://pypi/r/rax_scheduled_images_python_novaclient_ext/${name}.tar.gz";
sha256 = "1nvwjgrkp1p1d27an393qf49pszm1nvqa2ychhbqmp0bnabwyw7i";
};
propagatedBuildInputs = [ six novaclient ];
meta = {
homepage = https://pypi.python.org/pypi/rax_scheduled_images_python_novaclient_ext;
license = lib.licenses.asl20;
description = "Extends python-novaclient to use RAX-SI, the Rackspace Nova API Scheduled Images extension";
};
};
os-diskconfig-python-novaclient-ext = buildPythonPackage rec {
pname = "os_diskconfig_python_novaclient_ext";
version = "0.1.3";
name = pname + "-" + version;
src = fetchurl {
url = "mirror://pypi/o/os_diskconfig_python_novaclient_ext/${name}.tar.gz";
sha256 = "0xayy5nlkgl9yr0inqkwirlmar8pv1id29r59lj70g5plwrr5lg7";
};
propagatedBuildInputs = [ six novaclient ];
meta = {
homepage = https://pypi.python.org/pypi/os_diskconfig_python_novaclient_ext;
license = lib.licenses.asl20;
description = "Disk Config extension for python-novaclient";
};
};
in
buildPythonPackage rec {
pname = "rackspace-novaclient";
version = "2.1";
name = pname + "-" + version;
src = fetchurl {
url = "mirror://pypi/r/rackspace-novaclient/${name}.tar.gz";
sha256 = "1rzaa328hzm8hs9q99gvjr64x47fmcq4dv4656rzxq5s4gv49z12";
};
disabled = isPy3k;
propagatedBuildInputs = [
requests
novaclient
six
# extensions
ip-associations-python-novaclient-ext
os-diskconfig-python-novaclient-ext
os-networksv2-python-novaclient-ext
os-virtual-interfacesv2-python-novaclient-ext
rackspace-auth-openstack
rax-default-network-flags-python-novaclient-ext
rax-scheduled-images-python-novaclient-ext
];
meta = {
homepage = https://pypi.python.org/pypi/rackspace-novaclient/;
license = lib.licenses.asl20;
description = "Metapackage to install python-novaclient and Rackspace extensions";
maintainers = with lib.maintainers; [ teh ];
};
}

View File

@ -1,20 +1,25 @@
{ stdenv, buildPythonPackage, fetchurl, python,
unittest2, scripttest, pytz, pylint, tempest-lib, mock, testtools,
pbr, tempita, decorator, sqlalchemy, six, sqlparse
{ stdenv, buildPythonPackage, fetchPypi, python
, unittest2, scripttest, pytz, pylint, mock
, testtools, pbr, tempita, decorator, sqlalchemy
, six, sqlparse, testrepository
}:
buildPythonPackage rec {
pname = "sqlalchemy-migrate";
name = "${pname}-${version}";
version = "0.11.0";
src = fetchurl {
url = "mirror://pypi/s/sqlalchemy-migrate/${name}.tar.gz";
src = fetchPypi {
inherit pname version;
sha256 = "0ld2bihp9kmf57ykgzrfgxs4j9kxlw79sgdj9sfn47snw3izb2p6";
};
checkInputs = [ unittest2 scripttest pytz pylint mock testtools tempest-lib ];
checkInputs = [ unittest2 scripttest pytz pylint mock testtools testrepository ];
propagatedBuildInputs = [ pbr tempita decorator sqlalchemy six sqlparse ];
prePatch = ''
sed -i -e /tempest-lib/d \
-e /testtools/d \
test-requirements.txt
'';
checkPhase = ''
export PATH=$PATH:$out/bin
echo sqlite:///__tmp__ > test_db.cfg

View File

@ -1,4 +1,4 @@
{ stdenv, buildPythonPackage, fetchPypi, oslosphinx, pbr, six, argparse }:
{ stdenv, buildPythonPackage, fetchPypi, pbr, six, argparse }:
buildPythonPackage rec {
pname = "stevedore";
@ -12,7 +12,6 @@ buildPythonPackage rec {
doCheck = false;
buildInputs = [ oslosphinx ];
propagatedBuildInputs = [ pbr six argparse ];
meta = with stdenv.lib; {

View File

@ -16128,12 +16128,6 @@ with pkgs;
notmuch-addrlookup = callPackage ../applications/networking/mailreaders/notmuch-addrlookup { };
# Open Stack
nova = callPackage ../applications/virtualization/openstack/nova.nix { };
keystone = callPackage ../applications/virtualization/openstack/keystone.nix { };
neutron = callPackage ../applications/virtualization/openstack/neutron.nix { };
glance = callPackage ../applications/virtualization/openstack/glance.nix { };
nova-filters = callPackage ../applications/audio/nova-filters { };
nspluginwrapper = callPackage ../applications/networking/browsers/mozilla-plugins/nspluginwrapper {};

File diff suppressed because it is too large Load Diff