Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
Shortens the 'updating dynamic clusters' log (#1711)
Browse files Browse the repository at this point in the history
* Shortens the 'updating dynamic clusters' log

* Removes ca-cert from :goal-config

* Makes test_usage more reliable
  • Loading branch information
dposada authored Oct 16, 2020
1 parent b915deb commit 8cc56af
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion integration/tests/cook/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1944,7 +1944,7 @@ def main():
self.assertEqual('Hello world!', cli.decode(cp.stdout))

def test_usage(self):
command = 'sleep 300'
command = f'sleep {util.DEFAULT_TEST_TIMEOUT_SECS}'

# Submit un-grouped jobs
cp, uuids = cli.submit(command, self.cook_url, submit_flags='--cpus 0.1 --mem 16')
Expand Down
13 changes: 11 additions & 2 deletions scheduler/src/cook/compute_cluster.clj
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,18 @@
(defn update-compute-clusters-helper
"Helper function for update-compute-cluster and update-compute-clusters. See those functions for full description."
[conn db current-configs new-configs force?]
(let [updates (compute-config-updates db current-configs new-configs force?)]
(let [updates (compute-config-updates db current-configs new-configs force?)
dissoc-ca-cert
(fn [config]
(dissoc config :ca-cert))
dissoc-ca-cert-vals
(fn [configs]
(map-vals dissoc-ca-cert configs))]
(log/info "Updating dynamic clusters."
{:current-configs current-configs :new-configs new-configs :force? force? :updates updates})
{:current-configs (dissoc-ca-cert-vals current-configs)
:force? force?
:new-configs (dissoc-ca-cert-vals new-configs)
:updates (map #(update % :goal-config dissoc-ca-cert) updates)})
(let [updates-with-results (map
#(assoc % :update-result
(when (:valid? %) (execute-update! conn %)))
Expand Down

0 comments on commit 8cc56af

Please sign in to comment.