This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1302830 - For JBDS integration, CDK Vagrantfiles needs to setup use of env variables for registration plugin
For JBDS integration, CDK Vagrantfiles needs to setup use of env variables fo...
Status: ASSIGNED
Product: Container Development Kit (CDK)
Classification: Red Hat
Component: distribution (Show other bugs)
2.0
Unspecified Unspecified
urgent Severity urgent
: beta4
: 2.0
Assigned To: Lalatendu Mohanty
David Kutálek
Vikram Goyal
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-28 13:10 EST by David Kutálek
Modified: 2016-03-23 08:05 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description David Kutálek 2016-01-28 13:10:56 EST
Description of problem:

JBDS (eclipse) calls cdk vagrant in background without TTY,
it needs to pass username/password via env variables.

These needs to be added into cdk Vagrant files:

  config.registration.username = ENV['SUB_USERNAME']
  config.registration.password = ENV['SUB_PASSWORD']

I just tested that even with this setting, 
given that env variables are not set,
Vagrant will ask. This is important for non-JBDS use cases.

Version-Release number of selected component (if applicable):

beta4 cdk.zip

How reproducible:

Always

Steps to Reproduce:
1. Run vagrant up without tty, but with env variables mentioned above
2. Run vagrant up with tty but without variables
3.

Actual results:

1. does not work
2. does work (asks)

Expected results:

1. works without asking
2. works with asking
Comment 1 Ondřej Pták 2016-02-04 09:46:42 EST
On windows, with registration plugin expecting credentials from environment variables, I got question only for password, not for username, it can be problem, need to investigate more.
Comment 3 Lalatendu Mohanty 2016-02-18 11:01:18 EST
Added the env variables as requested.
Comment 5 Ondřej Pták 2016-02-25 03:14:51 EST
This should be solved a little bit differently. In expected usage it works fine, but problem is if vagrant-registration is not installed.
Without registration plugin, config.registration doesn't exists, so vagrant commands fails with traceback.

Proposed solution for discussion:
1) encapsulate these command with check for plugin:
if Vagrant.has_plugin?('vagrant-registration')
  config.registration.username = ENV['SUB_USERNAME']
  config.registration.password = ENV['SUB_PASSWORD']
end

2) print some nice error if plugin is not installed:
# check if plugin is installed on system
unless Vagrant.has_plugin?("vagrant-registration")
  raise "vagrant-registration plugin is not installed, run `vagrant plugin install vagrant-registration` to install the plugin."
end

Note You need to log in before you can comment on or make changes to this bug.