taskcat icon indicating copy to clipboard operation
taskcat copied to clipboard

Using same auto-generated value for multiple parameters

Open sshvans opened this issue 8 years ago • 8 comments

sshvans avatar Jun 29 '18 19:06 sshvans

Use case?

andrew-glenn avatar Jul 03 '18 19:07 andrew-glenn

Say you have two parameter inputs: Password and ConfirmPassword. If you generate a random value for Password, then the ConfirmPassword field must be passed the same randomly generated value.

vsnyc avatar Jul 03 '18 20:07 vsnyc

We can use these getter/setter https://github.com/aws-quickstart/taskcat/blob/master/taskcat/stacker.py#L349-L353 to store the generated password. I suggest adding a new runtime injection parameter maybe $[taskcat_confirm-genpass] which simply returns the last password that was generated. Easy enough to do if you @sshvans @agamzn @vsnyc concur. I can add it.

tonynv avatar Jul 03 '18 20:07 tonynv

Will this work when there are two password (e.g. admin, user) and two confirm password fields? Reference to a generated value will be a more futureproof solution. i.e.

Key: MyPassword Value: taskcat-genpass

Key: ConfirmPassword Value: taskcat-getval-$MyPassword.

Where, the MyPassword itself is an evaluated token which must match a defined key in the input file.

vsnyc avatar Jul 03 '18 20:07 vsnyc

Yep agree change _password to a dict and store the generated referencing the current parameter that is being processed.

Then add the get value method as @vsync suggested.

tonynv avatar Jul 03 '18 20:07 tonynv

Agreed. Make it happen, captain!

Sent from my iPhone

On Jul 3, 2018, at 15:56, Tony Vattathil <[email protected]mailto:[email protected]> wrote:

Yep agree change _password to a dict and store the generated referencing the current parameter that is being processed.

Then add the get value method as @vsynchttps://github.com/vsync suggested.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/aws-quickstart/taskcat/issues/94#issuecomment-402289388, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AckEUXMrM3EU2Vy_k9m5v3xQNhvcHiTDks5uC9pbgaJpZM4U9fjD.

andrew-glenn avatar Jul 04 '18 02:07 andrew-glenn

@sshvans https://github.com/aws-quickstart/taskcat/commit/a1a542d1a71daf1ba98c84a90dcdc4966b2fabcf should resolve this issue. When you get the chance can you pull the latest master and give it a spin?

tonynv avatar Jul 10 '18 12:07 tonynv

Works!

sshvans avatar Jul 27 '18 21:07 sshvans