deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject git commit: Deltacloud - rackspace driver - adds monkeypatch for cloudservers gem - DTACLOUD-319
Date Thu, 17 Jan 2013 16:21:20 GMT
Updated Branches:
  refs/heads/master 995910073 -> 101746213


Deltacloud - rackspace driver - adds monkeypatch for cloudservers gem - DTACLOUD-319

See https://issues.apache.org/jira/browse/DTACLOUD-319
Original pull request at https://github.com/rackspace/ruby-cloudservers/pull/22


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/10174621
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/10174621
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/10174621

Branch: refs/heads/master
Commit: 101746213183c5604dd99a5fcb9de02b98d2b658
Parents: 9959100
Author: marios <marios@redhat.com>
Authored: Mon Jan 14 10:52:19 2013 +0200
Committer: marios <marios@redhat.com>
Committed: Thu Jan 17 18:20:50 2013 +0200

----------------------------------------------------------------------
 .../drivers/rackspace/anti_cache_monkey_patch.rb   |   20 +++++++++++++++
 .../drivers/rackspace/rackspace_driver.rb          |    1 +
 2 files changed, 21 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/10174621/server/lib/deltacloud/drivers/rackspace/anti_cache_monkey_patch.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/rackspace/anti_cache_monkey_patch.rb b/server/lib/deltacloud/drivers/rackspace/anti_cache_monkey_patch.rb
new file mode 100644
index 0000000..8b9c11f
--- /dev/null
+++ b/server/lib/deltacloud/drivers/rackspace/anti_cache_monkey_patch.rb
@@ -0,0 +1,20 @@
+# This is a copy of code that has been submitted upstream
+# https://github.com/rackspace/ruby-cloudservers/pull/22
+#
+# Once the pull request is merged we can remove this patch
+# Also see https://issues.apache.org/jira/browse/DTACLOUD-319
+
+module CloudServers
+  class Connection
+
+    def list_servers_detail(options = {})
+      anti_cache_param="cacheid=#{Time.now.to_i}"
+      path = CloudServers.paginate(options).empty? ? "#{svrmgmtpath}/servers/detail?#{anti_cache_param}"
: "#{svrmgmtpath}/servers/detail?#{CloudServers.paginate(options)}&#{anti_cache_param}"
+      response = csreq("GET",svrmgmthost,path,svrmgmtport,svrmgmtscheme)
+      CloudServers::Exception.raise_exception(response) unless response.code.match(/^20.$/)
+      CloudServers.symbolize_keys(JSON.parse(response.body)["servers"])
+    end
+    alias :servers_detail :list_servers_detail
+
+  end
+end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/10174621/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb b/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
index 1412cf5..fb080ea 100644
--- a/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
+++ b/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
@@ -17,6 +17,7 @@
 require 'cloudfiles'
 require 'cloudservers'
 require 'base64'
+require_relative 'anti_cache_monkey_patch'
 
 module Deltacloud
   module Drivers


Mime
View raw message