Skip to content

Commit 976cda0

Browse files
committed
Replace platform.server_api_version with direct Pedant::Config.pedant_platform.server_api_version in cookbook_util for before(:all) compatibility
Signed-off-by: John McCrae <[email protected]>
1 parent 7718006 commit 976cda0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

oc-chef-pedant/lib/pedant/rspec/cookbook_util.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def new_cookbook_artifact_v2(name, identifier, opts = {})
248248
end
249249

250250
def new_cookbook_artifact(name, identifier, opts = {})
251-
if platform.server_api_version >= 2
251+
if Pedant::Config.pedant_platform.server_api_version >= 2
252252
new_cookbook_artifact_v2(name, identifier, opts)
253253
else
254254
new_cookbook_artifact_v0(name, identifier, opts)
@@ -442,7 +442,7 @@ def new_cookbook_v2(name, version, opts = {})
442442
end
443443

444444
def new_cookbook(name, version, opts = {})
445-
if platform.server_api_version >= 2
445+
if Pedant::Config.pedant_platform.server_api_version >= 2
446446
new_cookbook_v2(name, version, opts)
447447
else
448448
new_cookbook_v0(name, version, opts)
@@ -523,7 +523,7 @@ def retrieved_cookbook_v2(name, version, opts = {})
523523
# the API because it's not used by the client and wastes
524524
# bandwidth
525525
def retrieved_cookbook(name, version, opts = {})
526-
if platform.server_api_version >= 2
526+
if Pedant::Config.pedant_platform.server_api_version >= 2
527527
retrieved_cookbook_v2(name, version, opts)
528528
else
529529
retrieved_cookbook_v0(name, version, opts)
@@ -633,7 +633,7 @@ def get_latest_cookbooks(cookbook_spec, num_versions = 1)
633633
#
634634

635635
def checksums_for_type(type, cb_version = cookbook_version)
636-
if platform.server_api_version >= 2
636+
if Pedant::Config.pedant_platform.server_api_version >= 2
637637
checksums_for_all_files(type, cb_version)
638638
else
639639
checksums_for_segment_type(type, cb_version)
@@ -657,7 +657,7 @@ def checksums_for_all_files(type, cb_version = cookbook_version)
657657
end
658658

659659
def extract_segment(cbv, segment)
660-
if platform.server_api_version >= 2
660+
if Pedant::Config.pedant_platform.server_api_version >= 2
661661
files = cbv["all_files"] || []
662662
files.select do |f|
663663
seg, name = f["name"].split("/")
@@ -670,7 +670,7 @@ def extract_segment(cbv, segment)
670670
end
671671

672672
def select_segment(segment)
673-
if platform.server_api_version >= 2
673+
if Pedant::Config.pedant_platform.server_api_version >= 2
674674
"all_files"
675675
else
676676
segment

0 commit comments

Comments
 (0)