Created
July 10, 2013 22:39
-
-
Save hub-cap/5970833 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SingleInstanceConfigTemplate(object): | |
| - def __init__(self, config_location, flavor_multiplier): | |
| + def __init__(self, config_location, flavor_multiplier, disk_multiplier): | |
| self.config_location = config_location | |
| self.flavor_multiplier = flavor_multiplier | |
| + self.disk_multiplier = disk_multiplier | |
| self.template = get_env().get_template("mysql.config.template") | |
| def render(self): | |
| self.config_contents = self.template.render( | |
| - flavor_multiplier=self.flavor_multiplier) | |
| + flavor_multiplier=self.flavor_multiplier, | |
| + disk_multiplier=self.disk_multiplier) | |
| diff --git a/trove/tests/api/instances_resize.py b/trove/tests/api/instances_resize.py | |
| index e6400c2..f520ec1 100644 | |
| --- a/trove/tests/api/instances_resize.py | |
| +++ b/trove/tests/api/instances_resize.py | |
| @@ -110,7 +110,8 @@ class ResizeTests(ResizeTestBase): | |
| self._teardown() | |
| def _start_mysql(self): | |
| - config = template.SingleInstanceConfigTemplate("/etc/mysql/my.cnf", 2) | |
| + config = template.SingleInstanceConfigTemplate( | |
| + "/etc/mysql/my.cnf", 2, 1) | |
| config.render() | |
| self.instance.guest.start_db_with_conf_changes(config.config_location, | |
| config.config_contents) | |
| diff --git a/trove/tests/unittests/common/test_template.py b/trove/tests/unittests/common/test_template.py | |
| index f6de983..09facad 100644 | |
| --- a/trove/tests/unittests/common/test_template.py | |
| +++ b/trove/tests/unittests/common/test_template.py | |
| @@ -47,7 +47,7 @@ class TemplateTest(testtools.TestCase): | |
| def test_single_instance_config_rendering(self): | |
| location = "some_loc" | |
| - config = template.SingleInstanceConfigTemplate(location, 9) | |
| + config = template.SingleInstanceConfigTemplate(location, 9, 1) | |
| config.render() | |
| self.assertEqual(location, config.config_location) | |
| self.validate_template(config.config_contents, "query_cache_size", 9) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment