예제 #1
0
def _get(uuid):
    if request.args.get('installed') == 'mark':
        mark_host_installed(uuid)
        return make_response("", 200, [])
    if request.args.get('installed') == 'unmark':
        unmark_host_installed(uuid)
        return make_response("", 200, [])
    if request.args.get('params') == 'all':
        return jsonify(get_host_params(uuid))
    return jsonify(get_host(uuid))
예제 #2
0
    def test_mark_host_installed(self):
        with self.app.test_request_context('/'):
            result = hosts.mark_host_installed(self.host_id)
            params = copy.deepcopy(self.host_params)
            params["groups"].append("installed")
            result = hosts.get_host(self.host_id)
            self.assertEqual(result, params)

            result = hosts.unmark_host_installed(self.host_id)
            result = hosts.get_host(self.host_id)
            self.assertEqual(result, self.host_params)