Skip to content

Instantly share code, notes, and snippets.

View console
$> python ./test-notification-server.py
$> python test-notification.py --config-file ./test.conf --debug
$> git reset --hard 5315399
$> python test-notification-old.py --config-file ./test.conf --debug
View test-notification-server.py
class Kombu(object):
def __init__(self):
self.params = {
'hostname': 'localhost',
'port': 5672,
'virtual_host': '/',
View gist:9484531
diff --git a/nova/tests/api/openstack/compute/test_servers.py b/nova/tests/api/openstack/compute/test_servers.py
index 22dc9d4..7559896 100644
--- a/nova/tests/api/openstack/compute/test_servers.py
+++ b/nova/tests/api/openstack/compute/test_servers.py
@@ -4308,7 +4308,7 @@ class ServerXMLSerializationTest(test.TestCase):
def test_create(self):
serializer = servers.FullServerTemplate()
- self.body["server"]["adminPass"] = "test_password"
+ self.body["server"]["adminPass"] = u'\u89e3\u7801'
@markmc
markmc / gist:11295100
Created Apr 25, 2014
Nova API timestamp formats
View gist:11295100
$> git grep '20[0-9][0-9]-' doc/api_samples/ | wc -l
509
with UTC TZ:
$> git grep '20[0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]Z' doc/api_samples/ | wc -l
230
with zero offset TZ:
@markmc
markmc / PowerShellVmsResource.java
Created Feb 22, 2011
New getProcess() method
View PowerShellVmsResource.java
class PowerShellVmsResource {
enum Method { GET, ADD };
enum Detail { DISKS, STATISTICS };
static String getProcess(Method method, Set<Detail> details) {
StringBuilder buf = new StringBuilder();
if (details != null) {
if (details.contains(Detail.DISKS)) {
buf.append(GET_STATS);
@markmc
markmc / gist:988981
Created May 24, 2011
Minimal AS7 modules
View gist:988981
<modules>
<module>build</module>
<module>build-config</module>
<module>controller</module>
<module>controller-client</module>
<module>deployment-repository</module>
<module>deployment-scanner</module>
<module>domain-controller</module>
<module>domain-http-api</module>
<module>ee</module>
@markmc
markmc / gist:988985
Created May 24, 2011
Minimal AS7 deps analysis
View gist:988985
basic deps:
junit:junit:jar:4.8.1:test
core jboss bits with no deps:
org.jboss.logging:jboss-logging:jar:3.0.0.Beta3:compile
org.jboss.modules:jboss-modules:jar:1.0.0.Beta17:compile
org.jboss.msc:jboss-msc:jar:1.0.0.Beta8:compile
@markmc
markmc / gist:1000672
Created May 31, 2011
Image Factory Console Hack Hack
View gist:1000672
diff --git a/services/image_factory/console/lib/image_factory/image_factory_console.rb b/services/image_factory/console/lib/image_factory/image_factory_console.rb
index c196632..788d86f 100644
--- a/services/image_factory/console/lib/image_factory/image_factory_console.rb
+++ b/services/image_factory/console/lib/image_factory/image_factory_console.rb
@@ -65,8 +65,8 @@ class ImageFactoryConsole < Qmf2::ConsoleHandler
# TODO: return error if there is a problem calling this method or getting
# a factory instance
begin
- response = factory.image(descriptor, target)
- build_adaptor(response)
@markmc
markmc / gist:4488261
Created Jan 8, 2013
LazyPluggable and config groups
View gist:4488261
diff --git a/nova/utils.py b/nova/utils.py
index 30e2d80..c73af06 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -507,14 +507,18 @@ def str_dict_replace(s, mapping):
class LazyPluggable(object):
"""A pluggable backend loaded lazily based on some value."""
- def __init__(self, pivot, **backends):
+ def __init__(self, pivot, **backends, config_group=None):
View gist:4488277
diff --git a/nova/utils.py b/nova/utils.py
index 30e2d80..55921b8 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -507,14 +507,18 @@ def str_dict_replace(s, mapping):
class LazyPluggable(object):
"""A pluggable backend loaded lazily based on some value."""
- def __init__(self, pivot, **backends):
+ def __init__(self, pivot, config_group=None, **backends):