@@ -0,0 +1,1760 @@
+#!/usr/bin/env python3%0A# Copyright 2020 Canonical, Ltd.%0A#%0A# This program is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU Affero General Public License as%0A# published by the Free Software Foundation, either version 3 of the%0A# License, or (at your option) any later version.%0A#%0A# This program is distributed in the hope that it will be useful,%0A# but WITHOUT ANY WARRANTY; without even the implied warranty of%0A# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A# GNU Affero General Public License for more details.%0A#%0A# You should have received a copy of the GNU Affero General Public License%0A# along with this program.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A%0Aimport copy%0Aimport json%0Aimport sys%0A%0Afrom subiquity.cmd.tui import parse_options%0Afrom subiquity.core import Subiquity%0A%0Abase_schema = %7B%0A    'type': 'object',%0A    'properties': %7B%0A        'version': %7B%0A            'type': 'integer',%0A            'minumum': 1,%0A            'maximum': 2,%0A        %7D,%0A    %7D,%0A    'requiredProperties': %5B'version'%5D,%0A    'additionalProperties': True,%0A    %7D%0A%0A%0Adef make_schema(app):%0A    schema = copy.deepcopy(base_schema)%0A    for controller in app.controllers.instances:%0A        ckey = getattr(controller, 'autoinstall_key', None)%0A        if ckey is None:%0A            continue%0A        cschema = getattr(controller, %22autoinstall_schema%22, None)%0A        if cschema is None:%0A            continue%0A        schema%5B'properties'%5D%5Bckey%5D = cschema%0A    return schema%0A%0A%0Adef main():%0A    opts = parse_options(%5B%5D)%0A    opts.dry_run = True%0A    app = Subiquity(opts, None)%0A    app.base_model = app.make_model()%0A    app.controllers.load_all()%0A    json.dump(make_schema(app), sys.stdout, indent=4)%0A%0A%0Aif __name__ == '__main__':%0A    sys.exit(main())%0A

add command to dump schema out