Fix gate error

Looks like SQLAlchemy in version 1.2.x checks if the boolean value
is None, True, False, 1, or 0. We used a "1" in our test, which
does not seem to meet the requirements. In the meantime, if we
change it to 1 here, our function section needs to be changed
as well.

Change-Id: I8df2118fee12fd9dd02caf96a23bc59652efbed7
This commit is contained in:
jiansong 2018-01-31 01:49:58 -08:00
parent 393c5f8c00
commit 21dcb414e5
2 changed files with 4 additions and 3 deletions

View File

@ -212,7 +212,8 @@ def main():
'packages', help='Packages required by the datastore version that '
'are installed on the guest image.')
parser.add_argument(
'active', help='Whether the datastore version is active or not. '
'active', type=int,
help='Whether the datastore version is active or not. '
'Accepted values are 0 and 1.')
parser = subparser.add_parser(

View File

@ -31,10 +31,10 @@ class TestDatastoreVersion(trove_testtools.TestCase):
models.update_datastore(name='test_ds', default_version=None)
models.update_datastore_version(
'test_ds', 'test_vr1', 'mysql',
'154b350d-4d86-4214-9067-9c54b230c0da', 'pkg-1', '1')
'154b350d-4d86-4214-9067-9c54b230c0da', 'pkg-1', 1)
models.update_datastore_version(
'test_ds', 'test_vr2', 'mysql',
'154b350d-4d86-4214-9067-9c54b230c0da', 'pkg-1', '1')
'154b350d-4d86-4214-9067-9c54b230c0da', 'pkg-1', 1)
self.ds = models.Datastore.load('test_ds')
self.ds_version2 = models.DatastoreVersion.load(self.ds, 'test_vr2')