Permalink
Browse files

Added some more checks at the validate jobs command

- Check if deployment manifest has more than 1 release
- Check if the release name is found in deployment manifest
- Added a pending at the job property validator spec

Change-Id: I842c44857acf0c0a856e81d274eb58f1066ce2db
  • Loading branch information...
1 parent 6e46456 commit fbc75d3d4d9109d744e2ac007e35b5f336d04777 @frodenas frodenas committed Nov 4, 2012
Showing with 14 additions and 3 deletions.
  1. +13 −2 cli/lib/cli/commands/deployment.rb
  2. +1 −1 cli/spec/unit/job_property_validator_spec.rb
@@ -136,8 +136,19 @@ def validate_jobs
check_if_release_dir
manifest = prepare_deployment_manifest(:resolve_properties => true)
- nl
- say("Analyzing release directory...".yellow)
+ if manifest["release"]
+ release_name = manifest["release"]["name"]
+ elsif manifest["releases"].count > 1
+ err("Cannot validate a deployment manifest with more than 1 release")
+ else
+ release_name = manifest["releases"].first["name"]
+ end
+ if release_name == release.dev_name || release_name == release.final_name
+ nl
+ say("Analyzing release directory...".yellow)
+ else
+ err("This release was not found in deployment manifest")
+ end
say(" - discovering packages")
packages = Bosh::Cli::PackageBuilder.discover(
@@ -3,5 +3,5 @@
require "spec_helper"
describe Bosh::Cli::JobPropertyValidator do
-
+ pending "needs tests"
end

0 comments on commit fbc75d3

Please sign in to comment.