Created
January 7, 2014 13:59
-
-
Save AdamSaleh/8299686 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 Operatingsystem(ApiCrudMixin, ApiModelMixin,DataGeneratorMixin): | |
| @classmethod | |
| def api_path(cls): | |
| return "/api/operatingsystems/" | |
| @classmethod | |
| def id_from_json(cls, json): | |
| return json[u'operatingsystem'][u'id'] | |
| def opts(self): | |
| return {u'operatingsystem': self.to_data_structure()} | |
| def change(self): | |
| self.release_name += "updated" | |
| return self | |
| @required(name = regexdef(r"operatingsystem\d\d\d_.*"), | |
| major = partial(randint, 1, 8), | |
| minor = partial(randint, 1, 30), | |
| family = partial(choice, | |
| ["Archlinux", | |
| "Debian", | |
| "Freebsd", | |
| "Gentoo", | |
| "Redhat", | |
| "Solaris", | |
| "Suse", | |
| "Windows"]), | |
| release_name = regexdef(r"osrelease\d\d\d")) | |
| def __init__(self, **kwargs): | |
| pass | |
| class Host(DataGeneratorMixin): | |
| @classmethod | |
| def api_path(cls): | |
| return "/api/hosts/" | |
| @classmethod | |
| def id_from_json(cls, json): | |
| return json[u'host'][u'id'] | |
| def opts(self): | |
| return {u'host': self.to_data_structure()} | |
| def change(self): | |
| self.name += "updated" | |
| return self | |
| @required(name = regexdef(r"host_\d\d\d_.*"), | |
| environment = Environment, | |
| architecture = Architecture, | |
| domain = Domain, | |
| puppet_proxy = SmartProxy, | |
| operatingsystem = Operatingsystem) | |
| def __init__(self, **kwargs): | |
| pass | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment