{"action":"created","comment":{"url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/pulls/comments/91031805","pull_request_review_id":11541755,"id":91031805,"diff_hunk":"@@ -148,36 +148,51 @@ def _initParent(self, actor, args):\n         return None\n \n     def _initProducers(self, actor, args):\n+        \"\"\"\n+        Initialize the producers of an actor.\n \n-        for i, producer_model in enumerate(actor.model.dbobj.producers):\n-            producer_role = producer_model.actorRole\n+        actor: is the actor to init its producers.\n+        args: passed arguments in the blueprint (i.e {'ssh1':'main', 'sshlist':[]} )\n \n-            instances = args.get(producer_model.argKey, args.get(producer_role, \"\"))\n+        \"\"\"\n+\n+        # for every producer model in the producers, we get the user set services `argKey` to be consumed in the blueprintself.\n+        # calculate the difference of the available services and the user set\n+        # calculate the min required services and see if we should create new ones if auto is set\n+        # create the services required till the minServices is reached.\n+        # set add each to our producers and add ourself the their consumers list.\n+        # maintain the parent relationship (parent is always a producer and we are always a consumer of the parent.)\n \n-            if not j.data.types.list.check(instances):\n-                instances = [instances]\n+        for i, producer_model in enumerate(actor.model.dbobj.producers):\n+            usersetservices = []\n+            passedservicesnames = args.get(producer_model.argKey, [])","path":"lib/JumpScale/baselib/atyourservice81/Service.py","position":35,"original_position":35,"commit_id":"cd9bcc91b8f3bbcfa9ece7887160ddc8aa17e999","original_commit_id":"cd9bcc91b8f3bbcfa9ece7887160ddc8aa17e999","user":{"login":"zaibon","id":303164,"avatar_url":"https://avatars.githubusercontent.com/u/303164?v=3","gravatar_id":"","url":"https://api.github.com/users/zaibon","html_url":"https://github.com/zaibon","followers_url":"https://api.github.com/users/zaibon/followers","following_url":"https://api.github.com/users/zaibon/following{/other_user}","gists_url":"https://api.github.com/users/zaibon/gists{/gist_id}","starred_url":"https://api.github.com/users/zaibon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zaibon/subscriptions","organizations_url":"https://api.github.com/users/zaibon/orgs","repos_url":"https://api.github.com/users/zaibon/repos","events_url":"https://api.github.com/users/zaibon/events{/privacy}","received_events_url":"https://api.github.com/users/zaibon/received_events","type":"User","site_admin":false},"body":"`args.get(producer_model.argKey, args.get(producer_role, \"\"))` was better cause we support the role and the actual attribute set in the schema.\r\n\r\nin some schema the name of the attribute that define the producer is not the role of the producer.","created_at":"2016-12-06T08:40:03Z","updated_at":"2016-12-06T08:40:03Z","html_url":"https://github.com/Jumpscale/jumpscale_core8/pull/616#discussion_r91031805","pull_request_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/pulls/616","_links":{"self":{"href":"https://api.github.com/repos/Jumpscale/jumpscale_core8/pulls/comments/91031805"},"html":{"href":"https://github.com/Jumpscale/jumpscale_core8/pull/616#discussion_r91031805"},"pull_request":{"href":"https://api.github.com/repos/Jumpscale/jumpscale_core8/pulls/616"}}},"pull_request":{"url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/pulls/616","id":96678992,"html_url":"https://github.com/Jumpscale/jumpscale_core8/pull/616","diff_url":"https://github.com/Jumpscale/jumpscale_core8/pull/616.diff","patch_url":"https://github.com/Jumpscale/jumpscale_core8/pull/616.patch","issue_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/issues/616","number":616,"state":"open","locked":false,"title":"init fix for calculating producers #566","user":{"login":"xmonader","id":64129,"avatar_url":"https://avatars.githubusercontent.com/u/64129?v=3","gravatar_id":"","url":"https://api.github.com/users/xmonader","html_url":"https://github.com/xmonader","followers_url":"https://api.github.com/users/xmonader/followers","following_url":"https://api.github.com/users/xmonader/following{/other_user}","gists_url":"https://api.github.com/users/xmonader/gists{/gist_id}","starred_url":"https://api.github.com/users/xmonader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xmonader/subscriptions","organizations_url":"https://api.github.com/users/xmonader/orgs","repos_url":"https://api.github.com/users/xmonader/repos","events_url":"https://api.github.com/users/xmonader/events{/privacy}","received_events_url":"https://api.github.com/users/xmonader/received_events","type":"User","site_admin":false},"body":"Initial fix for #566 \r\n\r\n@zaibon  @ashraffouda  @rkhamis ","created_at":"2016-12-06T08:18:26Z","updated_at":"2016-12-06T08:43:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0cf90a716028905ac07a05d948d3165c34a1abbe","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/pulls/616/commits","review_comments_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/pulls/616/comments","review_comment_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/issues/616/comments","statuses_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/statuses/cd9bcc91b8f3bbcfa9ece7887160ddc8aa17e999","head":{"label":"Jumpscale:js8_566","ref":"js8_566","sha":"cd9bcc91b8f3bbcfa9ece7887160ddc8aa17e999","user":{"login":"Jumpscale","id":8423908,"avatar_url":"https://avatars.githubusercontent.com/u/8423908?v=3","gravatar_id":"","url":"https://api.github.com/users/Jumpscale","html_url":"https://github.com/Jumpscale","followers_url":"https://api.github.com/users/Jumpscale/followers","following_url":"https://api.github.com/users/Jumpscale/following{/other_user}","gists_url":"https://api.github.com/users/Jumpscale/gists{/gist_id}","starred_url":"https://api.github.com/users/Jumpscale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jumpscale/subscriptions","organizations_url":"https://api.github.com/users/Jumpscale/orgs","repos_url":"https://api.github.com/users/Jumpscale/repos","events_url":"https://api.github.com/users/Jumpscale/events{/privacy}","received_events_url":"https://api.github.com/users/Jumpscale/received_events","type":"Organization","site_admin":false},"repo":{"id":47390452,"name":"jumpscale_core8","full_name":"Jumpscale/jumpscale_core8","owner":{"login":"Jumpscale","id":8423908,"avatar_url":"https://avatars.githubusercontent.com/u/8423908?v=3","gravatar_id":"","url":"https://api.github.com/users/Jumpscale","html_url":"https://github.com/Jumpscale","followers_url":"https://api.github.com/users/Jumpscale/followers","following_url":"https://api.github.com/users/Jumpscale/following{/other_user}","gists_url":"https://api.github.com/users/Jumpscale/gists{/gist_id}","starred_url":"https://api.github.com/users/Jumpscale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jumpscale/subscriptions","organizations_url":"https://api.github.com/users/Jumpscale/orgs","repos_url":"https://api.github.com/users/Jumpscale/repos","events_url":"https://api.github.com/users/Jumpscale/events{/privacy}","received_events_url":"https://api.github.com/users/Jumpscale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Jumpscale/jumpscale_core8","description":"new jumpscale, cleaned up & only compatible with python 3.3+","fork":false,"url":"https://api.github.com/repos/Jumpscale/jumpscale_core8","forks_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/forks","keys_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/teams","hooks_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/hooks","issue_events_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/issues/events{/number}","events_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/events","assignees_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/assignees{/user}","branches_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/branches{/branch}","tags_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/tags","blobs_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/git/refs{/sha}","trees_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/statuses/{sha}","languages_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/languages","stargazers_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/stargazers","contributors_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/contributors","subscribers_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/subscribers","subscription_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/subscription","commits_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/commits{/sha}","git_commits_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/git/commits{/sha}","comments_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/comments{/number}","issue_comment_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/issues/comments{/number}","contents_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/contents/{+path}","compare_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/merges","archive_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/downloads","issues_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/issues{/number}","pulls_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/pulls{/number}","milestones_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/milestones{/number}","notifications_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/labels{/name}","releases_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/releases{/id}","deployments_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/deployments","created_at":"2015-12-04T08:10:17Z","updated_at":"2016-10-24T07:59:38Z","pushed_at":"2016-12-06T08:18:26Z","git_url":"git://github.com/Jumpscale/jumpscale_core8.git","ssh_url":"git@github.com:Jumpscale/jumpscale_core8.git","clone_url":"https://github.com/Jumpscale/jumpscale_core8.git","svn_url":"https://github.com/Jumpscale/jumpscale_core8","homepage":null,"size":9937,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":44,"forks":3,"open_issues":44,"watchers":4,"default_branch":"master"}},"base":{"label":"Jumpscale:8.1.0","ref":"8.1.0","sha":"2ad2153c70e77a34f700f945eb6ee9be1f6f8b74","user":{"login":"Jumpscale","id":8423908,"avatar_url":"https://avatars.githubusercontent.com/u/8423908?v=3","gravatar_id":"","url":"https://api.github.com/users/Jumpscale","html_url":"https://github.com/Jumpscale","followers_url":"https://api.github.com/users/Jumpscale/followers","following_url":"https://api.github.com/users/Jumpscale/following{/other_user}","gists_url":"https://api.github.com/users/Jumpscale/gists{/gist_id}","starred_url":"https://api.github.com/users/Jumpscale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jumpscale/subscriptions","organizations_url":"https://api.github.com/users/Jumpscale/orgs","repos_url":"https://api.github.com/users/Jumpscale/repos","events_url":"https://api.github.com/users/Jumpscale/events{/privacy}","received_events_url":"https://api.github.com/users/Jumpscale/received_events","type":"Organization","site_admin":false},"repo":{"id":47390452,"name":"jumpscale_core8","full_name":"Jumpscale/jumpscale_core8","owner":{"login":"Jumpscale","id":8423908,"avatar_url":"https://avatars.githubusercontent.com/u/8423908?v=3","gravatar_id":"","url":"https://api.github.com/users/Jumpscale","html_url":"https://github.com/Jumpscale","followers_url":"https://api.github.com/users/Jumpscale/followers","following_url":"https://api.github.com/users/Jumpscale/following{/other_user}","gists_url":"https://api.github.com/users/Jumpscale/gists{/gist_id}","starred_url":"https://api.github.com/users/Jumpscale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jumpscale/subscriptions","organizations_url":"https://api.github.com/users/Jumpscale/orgs","repos_url":"https://api.github.com/users/Jumpscale/repos","events_url":"https://api.github.com/users/Jumpscale/events{/privacy}","received_events_url":"https://api.github.com/users/Jumpscale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Jumpscale/jumpscale_core8","description":"new jumpscale, cleaned up & only compatible with python 3.3+","fork":false,"url":"https://api.github.com/repos/Jumpscale/jumpscale_core8","forks_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/forks","keys_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/teams","hooks_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/hooks","issue_events_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/issues/events{/number}","events_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/events","assignees_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/assignees{/user}","branches_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/branches{/branch}","tags_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/tags","blobs_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/git/refs{/sha}","trees_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/statuses/{sha}","languages_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/languages","stargazers_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/stargazers","contributors_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/contributors","subscribers_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/subscribers","subscription_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/subscription","commits_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/commits{/sha}","git_commits_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/git/commits{/sha}","comments_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/comments{/number}","issue_comment_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/issues/comments{/number}","contents_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/contents/{+path}","compare_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/merges","archive_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/downloads","issues_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/issues{/number}","pulls_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/pulls{/number}","milestones_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/milestones{/number}","notifications_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/labels{/name}","releases_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/releases{/id}","deployments_url":"https://api.github.com/repos/Jumpscale/jumpscale_core8/deployments","created_at":"2015-12-04T08:10:17Z","updated_at":"2016-10-24T07:59:38Z","pushed_at":"2016-12-06T08:18:26Z","git_url":"git://github.com/Jumpscale/jumpscale_core8.git","ssh_url":"git@github.com:Jumpscale/jumpscale_core8.git","clone_url":"https://github.com/Jumpscale/jumpscale_core8.git","svn_url":"https://github.com/Jumpscale/jumpscale_core8","homepage":null,"size":9937,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":44,"forks":3,"open_issues":44,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Jumpscale/jumpscale_core8/pulls/616"},"html":{"href":"https://github.com/Jumpscale/jumpscale_core8/pull/616"},"issue":{"href":"https://api.github.com/repos/Jumpscale/jumpscale_core8/issues/616"},"comments":{"href":"https://api.github.com/repos/Jumpscale/jumpscale_core8/issues/616/comments"},"review_comments":{"href":"https://api.github.com/repos/Jumpscale/jumpscale_core8/pulls/616/comments"},"review_comment":{"href":"https://api.github.com/repos/Jumpscale/jumpscale_core8/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Jumpscale/jumpscale_core8/pulls/616/commits"},"statuses":{"href":"https://api.github.com/repos/Jumpscale/jumpscale_core8/statuses/cd9bcc91b8f3bbcfa9ece7887160ddc8aa17e999"}}}}
{"actor":{"display_login":"zaibon"}}