Skip to content

Support for cpu_quota and cpu_period#770

Merged
aanand merged 3 commits into
masterfrom
cpu_cfs_opts_support
Sep 25, 2015
Merged

Support for cpu_quota and cpu_period#770
aanand merged 3 commits into
masterfrom
cpu_cfs_opts_support

Conversation

@shin-
Copy link
Copy Markdown
Contributor

@shin- shin- commented Sep 15, 2015

Fixes #766

Comment thread docker/utils/utils.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor thing, but this style of conditional makes me do a double-take - plus we're immediately doing another check in the second branch. I think a single outer check and two inner checks would be more normal.

Also, could we use version_lt? I find it much easier to read.

if cpu_quota:
    if not isinstance(cpu_quota, int):
        raise TypeError(...)
    if version_lt(version, '1.19'):
        raise errors.InvalidVersion(...)
    host_config['CpuQuota'] = cpu_quota

Same for the cpu_period conditional.

Signed-off-by: Joffrey F <joffrey@docker.com>
Signed-off-by: Joffrey F <joffrey@docker.com>
Signed-off-by: Joffrey F <joffrey@docker.com>
@shin- shin- force-pushed the cpu_cfs_opts_support branch from 6cf7758 to 3c5185c Compare September 24, 2015 17:11
@shin-
Copy link
Copy Markdown
Contributor Author

shin- commented Sep 24, 2015

Should be good now.

@aanand
Copy link
Copy Markdown
Contributor

aanand commented Sep 25, 2015

LGTM

aanand added a commit that referenced this pull request Sep 25, 2015
Support for cpu_quota and cpu_period
@aanand aanand merged commit 26e22bb into master Sep 25, 2015
@shin- shin- deleted the cpu_cfs_opts_support branch November 12, 2015 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants