Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added vmapp_name attribute #4

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ tmp
*.sw?
*~
.env.sh
.idea
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,14 @@ platforms:
- name: centos
driver:
catalog_name: Public Catalog
node_name: Linux-hostname
vmapp_name: VMapp-Linux
image_name: CentOS64-64BIT
- name: windows
driver:
catalog_name: Public Catalog
node_name: Windows-hostname
vmapp_name: VMapp-Windows
image_name: W2K12-STD-R2-64BIT
cpus: 2
memory: 4096
Expand Down
6 changes: 5 additions & 1 deletion lib/kitchen/driver/vcair.rb
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ def node_name
config[:node_name] || generate_node_name
end

def vmapp_name
config[:vmapp_name] || generate_node_name
end

def generate_node_name
# SecureRandom.hex generates a string 2x the argument.
# We need the name to be 15 chars or less to play nicely
Expand Down Expand Up @@ -305,7 +309,7 @@ def validate_customization_script!
end

def instantiate
image.instantiate(node_name, instantiate_config)
image.instantiate(vmapp_name, instantiate_config)
end

def vapp
Expand Down
5 changes: 2 additions & 3 deletions spec/vcair_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@
logger: logger,
transport: transport,
platform: platform,
to_str: 'instance_str'
)
to_str: 'instance_str')
end

before do
Expand Down Expand Up @@ -699,7 +698,7 @@

it 'calls instantiate on the image' do
allow(driver).to receive(:image).and_return(image)
allow(driver).to receive(:node_name).and_return('node')
allow(driver).to receive(:vmapp_name).and_return('node')
allow(driver).to receive(:instantiate_config).and_return('config')
expect(image).to receive(:instantiate).with('node', 'config')

Expand Down