bosh_vcloud_cpi 0.7.6 → 0.7.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf7473f0bbaafdc184e9fe8923772d86ad365c8f
4
- data.tar.gz: c055af6d12a18656c12c5bb242d1947ffff07890
3
+ metadata.gz: 07d91dc15ea8945ce0b95c3b27544e22ef364f5b
4
+ data.tar.gz: 349ef92995b29e875dcada52f16d22e4081770ce
5
5
  SHA512:
6
- metadata.gz: 12a08c0323b6f09f2e8d0d8fa827aa0c0087adfa980882260d99bac73e2f68047db9d3cd1c83b5d1351f15abcde23e693f2799bd84db9df090faee2c3768fbfd
7
- data.tar.gz: 896a4a062153993c66caf2a803636c6ecf89ae723512859bfb352a85c5e922b43a857efc39ebfb6d343582349dd69abc224eeab6a037160129cdfd75808f88c3
6
+ metadata.gz: 71a8bda2ffac0f6df601119fcaf0fcd9a7b2dfdb30dec1eaca871a926a7a0dbfc7b46de099b1f365ef69e845225b4e6050c0627af52e53095b378859d7ba4ec8
7
+ data.tar.gz: c88c7e27548b5e1ed7cd7fb576f1e8d8b50202e2fd53d5cdec3724f31bc2ece235144e6541adcd61b5845fde6ca6fa275dff845ec40c715b478966d5a0b8fb2f
@@ -10,7 +10,7 @@ module VCloudCloud
10
10
  client.timed_loop do
11
11
  media = client.reload media
12
12
  vm = client.reload vm
13
- if media.running_tasks.empty?
13
+ if media.running_tasks.empty? && media.prerunning_tasks.empty?
14
14
  client.invoke_and_wait :post, vm.insert_media_link,
15
15
  :payload => params,
16
16
  :headers => { :content_type => VCloudSdk::Xml::MEDIA_TYPE[:MEDIA_INSERT_EJECT_PARAMS] }
@@ -145,9 +145,15 @@ module VCloudCloud
145
145
  end
146
146
 
147
147
  def wait_entity(entity, accept_failure = false)
148
- entity.running_tasks.each do |task|
148
+ prerunning_tasks = entity.prerunning_tasks
149
+ prerunning_tasks.each do |task|
149
150
  wait_task task, accept_failure
150
- end if entity.running_tasks && !entity.running_tasks.empty?
151
+ end if prerunning_tasks && !prerunning_tasks.empty?
152
+
153
+ running_tasks = entity.running_tasks
154
+ running_tasks.each do |task|
155
+ wait_task task, accept_failure
156
+ end if running_tasks && !running_tasks.empty?
151
157
 
152
158
  entity = reload entity
153
159
 
@@ -70,6 +70,8 @@ module VCloudSdk
70
70
  :ABORTED => "aborted"
71
71
  }
72
72
 
73
+ PRE_RUNNING_TASK_STATUSES = [TASK_STATUS[:QUEUED], TASK_STATUS[:PRE_RUNNING]]
74
+
73
75
  MAX_DISK_ID = 15
74
76
 
75
77
  MEDIA_TYPE = {
@@ -15,6 +15,10 @@ module VCloudSdk
15
15
  end
16
16
  end
17
17
 
18
+ def prerunning_tasks
19
+ tasks.find_all { |t| PRE_RUNNING_TASK_STATUSES.include?(t.status) }
20
+ end
21
+
18
22
  def running_tasks
19
23
  tasks.find_all {|t| RUNNING.include?(t.status)}
20
24
  end
@@ -24,6 +24,10 @@ module VCloudSdk
24
24
  @root["size"].to_i/1024/1024
25
25
  end
26
26
 
27
+ def prerunning_tasks
28
+ tasks.find_all { |t| PRE_RUNNING_TASK_STATUSES.include?(t.status) }
29
+ end
30
+
27
31
  def running_tasks
28
32
  tasks.find_all {|t| RUNNING.include?(t.status)}
29
33
  end
@@ -44,6 +44,10 @@ module VCloudSdk
44
44
  get_nodes("Link", {"rel" => "remove"}, true).first
45
45
  end
46
46
 
47
+ def prerunning_tasks
48
+ tasks.find_all { |t| PRE_RUNNING_TASK_STATUSES.include?(t.status) }
49
+ end
50
+
47
51
  def running_tasks
48
52
  get_nodes("Task", {"status" => "running"})
49
53
  end
@@ -33,6 +33,10 @@ module VCloudSdk
33
33
  fix_if_invalid(link, "remove", "", href)
34
34
  end
35
35
 
36
+ def prerunning_tasks
37
+ tasks.find_all { |t| PRE_RUNNING_TASK_STATUSES.include?(t.status) }
38
+ end
39
+
36
40
  def running_tasks
37
41
  get_nodes("Task", {"status" => "running"})
38
42
  end
@@ -76,6 +76,10 @@ module VCloudSdk
76
76
  get_nodes("Link", {"type" => MEDIA_TYPE[:VAPP]}, true).first
77
77
  end
78
78
 
79
+ def prerunning_tasks
80
+ tasks.find_all { |t| PRE_RUNNING_TASK_STATUSES.include?(t.status) }
81
+ end
82
+
79
83
  def running_tasks
80
84
  get_nodes("Task", {"status" => "running"})
81
85
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bosh_vcloud_cpi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.6
4
+ version: 0.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - VMware
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-29 00:00:00.000000000 Z
11
+ date: 2015-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bosh_common
@@ -124,7 +124,7 @@ dependencies:
124
124
  version: '0'
125
125
  description: |-
126
126
  BOSH vCloud CPI
127
- 152369
127
+ c90a70
128
128
  email: support@cloudfoundry.com
129
129
  executables: []
130
130
  extensions: []
@@ -417,7 +417,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
417
417
  version: '0'
418
418
  requirements: []
419
419
  rubyforge_project:
420
- rubygems_version: 2.4.3
420
+ rubygems_version: 2.2.2
421
421
  signing_key:
422
422
  specification_version: 4
423
423
  summary: BOSH vCloud CPI