Skip to content

Instantly share code, notes, and snippets.

View markmc's full-sized avatar

Mark McLoughlin markmc

View GitHub Profile
@markmc
markmc / console
Last active August 29, 2015 13:56
$> 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
class Kombu(object):
def __init__(self):
self.params = {
'hostname': 'localhost',
'port': 5672,
'virtual_host': '/',
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 April 25, 2014 16:21
Nova API timestamp formats
$> 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 February 22, 2011 12:08
New getProcess() method
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 15:54
Minimal AS7 modules
<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 15:55
Minimal AS7 deps analysis
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 15:15
Image Factory Console Hack Hack
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 January 8, 2013 21:43
LazyPluggable and config groups
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):
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):