{"action":"created","comment":{"url":"https://api.github.com/repos/cockpit-project/cockpit/pulls/comments/131515372","pull_request_review_id":54509006,"id":131515372,"diff_hunk":"@@ -481,5 +481,64 @@ WantedBy=default.target\n \n         self.allow_restart_journal_messages()\n \n+    def testConditions(self):\n+        m = self.machine\n+        b = self.browser\n+        m.write(\"/etc/systemd/system/condtest.service\",\n+\"\"\"\n+[Unit]\n+Description=Test Service\n+ConditionDirectoryNotEmpty=/var/tmp/empty\n+\n+[Service]\n+ExecStart=/bin/sh -c \"while true; do sleep 5; done\"\n+\n+[Install]\n+WantedBy=multi-user.target\n+\"\"\")\n+\n+        m.execute(\"mkdir -p /var/tmp/empty\")\n+        m.execute(\"rm -rf /var/tmp/empty/*\")\n+\n+        # After writing files out tell systemd about them\n+        m.execute(\"systemctl daemon-reload\")\n+        self.machine.execute(\"systemctl start multi-user.target\")\n+\n+        # This does not work for not enabled services. See:\n+        # https://github.com/systemd/systemd/issues/2234\n+        self.machine.execute(\"systemctl enable condtest\")\n+\n+        self.login_and_go(\"/system/services\")\n+\n+        def svc_sel(service):\n+            return 'tr[data-goto-unit=\"%s\"]' % service\n+\n+        unit_action_btn = '#service-valid .list-group-item:nth-child(1) .btn-group'\n+        file_action_btn = '#service-valid .list-group-item:nth-child(2) .btn-group'","path":"test/verify/check-services","position":37,"original_position":37,"commit_id":"0dc5b593402791502f72a542b995eff2f2148b91","original_commit_id":"0dc5b593402791502f72a542b995eff2f2148b91","user":{"login":"petervo","id":10439156,"avatar_url":"https://avatars0.githubusercontent.com/u/10439156?v=4","gravatar_id":"","url":"https://api.github.com/users/petervo","html_url":"https://github.com/petervo","followers_url":"https://api.github.com/users/petervo/followers","following_url":"https://api.github.com/users/petervo/following{/other_user}","gists_url":"https://api.github.com/users/petervo/gists{/gist_id}","starred_url":"https://api.github.com/users/petervo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petervo/subscriptions","organizations_url":"https://api.github.com/users/petervo/orgs","repos_url":"https://api.github.com/users/petervo/repos","events_url":"https://api.github.com/users/petervo/events{/privacy}","received_events_url":"https://api.github.com/users/petervo/received_events","type":"User","site_admin":false},"body":"This is still unused, needs to be removed for the pyflakes tests to pass","created_at":"2017-08-05T05:48:44Z","updated_at":"2017-08-05T05:48:44Z","html_url":"https://github.com/cockpit-project/cockpit/pull/7453#discussion_r131515372","pull_request_url":"https://api.github.com/repos/cockpit-project/cockpit/pulls/7453","_links":{"self":{"href":"https://api.github.com/repos/cockpit-project/cockpit/pulls/comments/131515372"},"html":{"href":"https://github.com/cockpit-project/cockpit/pull/7453#discussion_r131515372"},"pull_request":{"href":"https://api.github.com/repos/cockpit-project/cockpit/pulls/7453"}}},"pull_request":{"url":"https://api.github.com/repos/cockpit-project/cockpit/pulls/7453","id":134103248,"html_url":"https://github.com/cockpit-project/cockpit/pull/7453","diff_url":"https://github.com/cockpit-project/cockpit/pull/7453.diff","patch_url":"https://github.com/cockpit-project/cockpit/pull/7453.patch","issue_url":"https://api.github.com/repos/cockpit-project/cockpit/issues/7453","number":7453,"state":"open","locked":false,"title":"systemd: Inform about not met conditions","user":{"login":"marusak","id":12330670,"avatar_url":"https://avatars2.githubusercontent.com/u/12330670?v=4","gravatar_id":"","url":"https://api.github.com/users/marusak","html_url":"https://github.com/marusak","followers_url":"https://api.github.com/users/marusak/followers","following_url":"https://api.github.com/users/marusak/following{/other_user}","gists_url":"https://api.github.com/users/marusak/gists{/gist_id}","starred_url":"https://api.github.com/users/marusak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marusak/subscriptions","organizations_url":"https://api.github.com/users/marusak/orgs","repos_url":"https://api.github.com/users/marusak/repos","events_url":"https://api.github.com/users/marusak/events{/privacy}","received_events_url":"https://api.github.com/users/marusak/received_events","type":"User","site_admin":false},"body":"Hi cockpit folks!\r\n\r\nToday I played with services a little bit. I was keen to use Cockpit for it.\r\nWhen starting abrt-vmcore I felt like something is broken.\r\nLittle did I realize that some conditions can fail and service won't be\r\nstarted. Now in Cockpit this can be very confusing, since clicking\r\n`start` button does not seem to do anything.\r\n\r\nAfter this patch failed conditions are listed.\r\n\r\nHow to reproduce:\r\n1) Make sure that /var/crash is empty\r\n2) Try to start abrt-vmcore service (Harvest vmcores for ABRT)\r\n\r\nResult:\r\nNothing happens\r\n\r\nExpected result:\r\nEither service is started or I am informed why the service could not be started\r\n\r\nThis is the view if all conditions are met:\r\n![all_met](https://user-images.githubusercontent.com/12330670/28957357-d1aec6e2-78f1-11e7-8ca4-db55f6aa575d.png)\r\nThis is the view if some conditions are not met:\r\n![one_not_met](https://user-images.githubusercontent.com/12330670/28957358-d1b15650-78f1-11e7-8962-f196a93a9681.png)\r\n\r\nNote 1: I am not sure what is your take on this. I was just really confused when I tried to start the mentioned service and it was doing nothing. Then I looked into `service abrt-vmcore status` and quickly realized what I was forgetting.\r\n\r\nNote 2: Documentations says, that all conditions must be met and `and` operator is used. I think that short-circuit evaluation is used so never more than one condition will be mentioned. But I might be wrong, so I did it as I was excepting more conditions not to be met. (I tried it with more conditions failing, and only the last one was visible both in cockpit and service tool).\r\n\r\nNote 3: I am not a UX guy, so if you do not like the design, send me some mockups and I gladly make it that way.\r\n\r\nNote 4: No tests yet. I do not want to spent to much time on it (I did it while eating my breakfast today), if you say you do not want it.\r\n\r\n","created_at":"2017-08-04T07:05:21Z","updated_at":"2017-08-05T05:48:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5fb9cfbffd73676bc35bd76174e71c832a2b41b0","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/cockpit-project/cockpit/pulls/7453/commits","review_comments_url":"https://api.github.com/repos/cockpit-project/cockpit/pulls/7453/comments","review_comment_url":"https://api.github.com/repos/cockpit-project/cockpit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cockpit-project/cockpit/issues/7453/comments","statuses_url":"https://api.github.com/repos/cockpit-project/cockpit/statuses/0dc5b593402791502f72a542b995eff2f2148b91","head":{"label":"marusak:not_met_conditions","ref":"not_met_conditions","sha":"0dc5b593402791502f72a542b995eff2f2148b91","user":{"login":"marusak","id":12330670,"avatar_url":"https://avatars2.githubusercontent.com/u/12330670?v=4","gravatar_id":"","url":"https://api.github.com/users/marusak","html_url":"https://github.com/marusak","followers_url":"https://api.github.com/users/marusak/followers","following_url":"https://api.github.com/users/marusak/following{/other_user}","gists_url":"https://api.github.com/users/marusak/gists{/gist_id}","starred_url":"https://api.github.com/users/marusak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marusak/subscriptions","organizations_url":"https://api.github.com/users/marusak/orgs","repos_url":"https://api.github.com/users/marusak/repos","events_url":"https://api.github.com/users/marusak/events{/privacy}","received_events_url":"https://api.github.com/users/marusak/received_events","type":"User","site_admin":false},"repo":{"id":84037260,"name":"cockpit","full_name":"marusak/cockpit","owner":{"login":"marusak","id":12330670,"avatar_url":"https://avatars2.githubusercontent.com/u/12330670?v=4","gravatar_id":"","url":"https://api.github.com/users/marusak","html_url":"https://github.com/marusak","followers_url":"https://api.github.com/users/marusak/followers","following_url":"https://api.github.com/users/marusak/following{/other_user}","gists_url":"https://api.github.com/users/marusak/gists{/gist_id}","starred_url":"https://api.github.com/users/marusak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marusak/subscriptions","organizations_url":"https://api.github.com/users/marusak/orgs","repos_url":"https://api.github.com/users/marusak/repos","events_url":"https://api.github.com/users/marusak/events{/privacy}","received_events_url":"https://api.github.com/users/marusak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/marusak/cockpit","description":"There's code a goin' on","fork":true,"url":"https://api.github.com/repos/marusak/cockpit","forks_url":"https://api.github.com/repos/marusak/cockpit/forks","keys_url":"https://api.github.com/repos/marusak/cockpit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marusak/cockpit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marusak/cockpit/teams","hooks_url":"https://api.github.com/repos/marusak/cockpit/hooks","issue_events_url":"https://api.github.com/repos/marusak/cockpit/issues/events{/number}","events_url":"https://api.github.com/repos/marusak/cockpit/events","assignees_url":"https://api.github.com/repos/marusak/cockpit/assignees{/user}","branches_url":"https://api.github.com/repos/marusak/cockpit/branches{/branch}","tags_url":"https://api.github.com/repos/marusak/cockpit/tags","blobs_url":"https://api.github.com/repos/marusak/cockpit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marusak/cockpit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marusak/cockpit/git/refs{/sha}","trees_url":"https://api.github.com/repos/marusak/cockpit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marusak/cockpit/statuses/{sha}","languages_url":"https://api.github.com/repos/marusak/cockpit/languages","stargazers_url":"https://api.github.com/repos/marusak/cockpit/stargazers","contributors_url":"https://api.github.com/repos/marusak/cockpit/contributors","subscribers_url":"https://api.github.com/repos/marusak/cockpit/subscribers","subscription_url":"https://api.github.com/repos/marusak/cockpit/subscription","commits_url":"https://api.github.com/repos/marusak/cockpit/commits{/sha}","git_commits_url":"https://api.github.com/repos/marusak/cockpit/git/commits{/sha}","comments_url":"https://api.github.com/repos/marusak/cockpit/comments{/number}","issue_comment_url":"https://api.github.com/repos/marusak/cockpit/issues/comments{/number}","contents_url":"https://api.github.com/repos/marusak/cockpit/contents/{+path}","compare_url":"https://api.github.com/repos/marusak/cockpit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marusak/cockpit/merges","archive_url":"https://api.github.com/repos/marusak/cockpit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marusak/cockpit/downloads","issues_url":"https://api.github.com/repos/marusak/cockpit/issues{/number}","pulls_url":"https://api.github.com/repos/marusak/cockpit/pulls{/number}","milestones_url":"https://api.github.com/repos/marusak/cockpit/milestones{/number}","notifications_url":"https://api.github.com/repos/marusak/cockpit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marusak/cockpit/labels{/name}","releases_url":"https://api.github.com/repos/marusak/cockpit/releases{/id}","deployments_url":"https://api.github.com/repos/marusak/cockpit/deployments","created_at":"2017-03-06T06:18:43Z","updated_at":"2017-03-06T06:18:48Z","pushed_at":"2017-08-05T05:09:57Z","git_url":"git://github.com/marusak/cockpit.git","ssh_url":"git@github.com:marusak/cockpit.git","clone_url":"https://github.com/marusak/cockpit.git","svn_url":"https://github.com/marusak/cockpit","homepage":"http://www.cockpit-project.org/","size":35075,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cockpit-project:master","ref":"master","sha":"1f42cf991ce78f13ea04173e6b873b19be315887","user":{"login":"cockpit-project","id":5765104,"avatar_url":"https://avatars2.githubusercontent.com/u/5765104?v=4","gravatar_id":"","url":"https://api.github.com/users/cockpit-project","html_url":"https://github.com/cockpit-project","followers_url":"https://api.github.com/users/cockpit-project/followers","following_url":"https://api.github.com/users/cockpit-project/following{/other_user}","gists_url":"https://api.github.com/users/cockpit-project/gists{/gist_id}","starred_url":"https://api.github.com/users/cockpit-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockpit-project/subscriptions","organizations_url":"https://api.github.com/users/cockpit-project/orgs","repos_url":"https://api.github.com/users/cockpit-project/repos","events_url":"https://api.github.com/users/cockpit-project/events{/privacy}","received_events_url":"https://api.github.com/users/cockpit-project/received_events","type":"Organization","site_admin":false},"repo":{"id":14049216,"name":"cockpit","full_name":"cockpit-project/cockpit","owner":{"login":"cockpit-project","id":5765104,"avatar_url":"https://avatars2.githubusercontent.com/u/5765104?v=4","gravatar_id":"","url":"https://api.github.com/users/cockpit-project","html_url":"https://github.com/cockpit-project","followers_url":"https://api.github.com/users/cockpit-project/followers","following_url":"https://api.github.com/users/cockpit-project/following{/other_user}","gists_url":"https://api.github.com/users/cockpit-project/gists{/gist_id}","starred_url":"https://api.github.com/users/cockpit-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockpit-project/subscriptions","organizations_url":"https://api.github.com/users/cockpit-project/orgs","repos_url":"https://api.github.com/users/cockpit-project/repos","events_url":"https://api.github.com/users/cockpit-project/events{/privacy}","received_events_url":"https://api.github.com/users/cockpit-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cockpit-project/cockpit","description":"There's code a goin' on","fork":false,"url":"https://api.github.com/repos/cockpit-project/cockpit","forks_url":"https://api.github.com/repos/cockpit-project/cockpit/forks","keys_url":"https://api.github.com/repos/cockpit-project/cockpit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cockpit-project/cockpit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cockpit-project/cockpit/teams","hooks_url":"https://api.github.com/repos/cockpit-project/cockpit/hooks","issue_events_url":"https://api.github.com/repos/cockpit-project/cockpit/issues/events{/number}","events_url":"https://api.github.com/repos/cockpit-project/cockpit/events","assignees_url":"https://api.github.com/repos/cockpit-project/cockpit/assignees{/user}","branches_url":"https://api.github.com/repos/cockpit-project/cockpit/branches{/branch}","tags_url":"https://api.github.com/repos/cockpit-project/cockpit/tags","blobs_url":"https://api.github.com/repos/cockpit-project/cockpit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cockpit-project/cockpit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cockpit-project/cockpit/git/refs{/sha}","trees_url":"https://api.github.com/repos/cockpit-project/cockpit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cockpit-project/cockpit/statuses/{sha}","languages_url":"https://api.github.com/repos/cockpit-project/cockpit/languages","stargazers_url":"https://api.github.com/repos/cockpit-project/cockpit/stargazers","contributors_url":"https://api.github.com/repos/cockpit-project/cockpit/contributors","subscribers_url":"https://api.github.com/repos/cockpit-project/cockpit/subscribers","subscription_url":"https://api.github.com/repos/cockpit-project/cockpit/subscription","commits_url":"https://api.github.com/repos/cockpit-project/cockpit/commits{/sha}","git_commits_url":"https://api.github.com/repos/cockpit-project/cockpit/git/commits{/sha}","comments_url":"https://api.github.com/repos/cockpit-project/cockpit/comments{/number}","issue_comment_url":"https://api.github.com/repos/cockpit-project/cockpit/issues/comments{/number}","contents_url":"https://api.github.com/repos/cockpit-project/cockpit/contents/{+path}","compare_url":"https://api.github.com/repos/cockpit-project/cockpit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cockpit-project/cockpit/merges","archive_url":"https://api.github.com/repos/cockpit-project/cockpit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cockpit-project/cockpit/downloads","issues_url":"https://api.github.com/repos/cockpit-project/cockpit/issues{/number}","pulls_url":"https://api.github.com/repos/cockpit-project/cockpit/pulls{/number}","milestones_url":"https://api.github.com/repos/cockpit-project/cockpit/milestones{/number}","notifications_url":"https://api.github.com/repos/cockpit-project/cockpit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cockpit-project/cockpit/labels{/name}","releases_url":"https://api.github.com/repos/cockpit-project/cockpit/releases{/id}","deployments_url":"https://api.github.com/repos/cockpit-project/cockpit/deployments","created_at":"2013-11-01T17:36:46Z","updated_at":"2017-08-04T02:56:45Z","pushed_at":"2017-08-05T05:09:59Z","git_url":"git://github.com/cockpit-project/cockpit.git","ssh_url":"git@github.com:cockpit-project/cockpit.git","clone_url":"https://github.com/cockpit-project/cockpit.git","svn_url":"https://github.com/cockpit-project/cockpit","homepage":"http://www.cockpit-project.org/","size":35163,"stargazers_count":2235,"watchers_count":2235,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":324,"mirror_url":null,"open_issues_count":424,"forks":324,"open_issues":424,"watchers":2235,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cockpit-project/cockpit/pulls/7453"},"html":{"href":"https://github.com/cockpit-project/cockpit/pull/7453"},"issue":{"href":"https://api.github.com/repos/cockpit-project/cockpit/issues/7453"},"comments":{"href":"https://api.github.com/repos/cockpit-project/cockpit/issues/7453/comments"},"review_comments":{"href":"https://api.github.com/repos/cockpit-project/cockpit/pulls/7453/comments"},"review_comment":{"href":"https://api.github.com/repos/cockpit-project/cockpit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cockpit-project/cockpit/pulls/7453/commits"},"statuses":{"href":"https://api.github.com/repos/cockpit-project/cockpit/statuses/0dc5b593402791502f72a542b995eff2f2148b91"}}}}
{"actor":{"display_login":"petervo"}}