saltstack-formulas / mysql-formula

Install the MySQL client and/or server
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
85 stars 366 forks source link

fix(db_load): preserve whitespace between -h and -p on the db load `c… #234

Closed sticky-note closed 4 years ago

sticky-note commented 4 years ago

…md.wait`

When loading a file into a database on creation, the generated cmd.wait used to be:

mysql -u root -hlocalhost-p1889959522 db < ./db.schema

which failed. This fix permit to preserve whitespace between -h -p flags

myii commented 4 years ago

Appreciate the fix, @sticky-note.

saltstack-formulas-travis commented 4 years ago

:tada: This PR is included in version 0.52.5 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

daks commented 4 years ago

this seems to come from my previous PR, sorry. Tests don't cover this?

myii commented 4 years ago

@daks Comparing the debug output:

With the actual file shows that it doesn't get into this if block:

https://github.com/saltstack-formulas/mysql-formula/blob/4008cf21ecdb86ebd2a4839f56c71da4dc4ee214/mysql/database.sls#L43-L63

The test pillar would have to be modified around these lines:

https://github.com/saltstack-formulas/mysql-formula/blob/4008cf21ecdb86ebd2a4839f56c71da4dc4ee214/test/salt/pillar/mysql.sls#L70-L103

So that a database exists where a schema is loaded.

Anyone fancy taking this on? I won't have time for this.