{"action":"created","comment":{"url":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/comments/36098407","id":36098407,"diff_hunk":"@@ -52,53 +49,70 @@ def getLFNList( LFNs ):\n   from DIRAC.RequestManagementSystem.Client.File import File\n   from DIRAC.RequestManagementSystem.Client.ReqClient import ReqClient\n   from DIRAC.Resources.Catalog.FileCatalog import FileCatalog\n+  from DIRAC.Core.Utilities.List import breakListIntoChunks\n \n-  metaDatas = FileCatalog().getFileMetadata( lfnList )\n-  if not metaDatas[\"OK\"]:\n-    gLogger.error( \"unable to read metadata for lfns: %s\" % metaDatas[\"Message\"] )\n-    DIRAC.exit( -1 )\n-  metaDatas = metaDatas[\"Value\"]\n-  for failedLFN, reason in metaDatas[\"Failed\"].items():\n-    gLogger.error( \"skipping %s: %s\" % ( failedLFN, reason ) )\n-  lfnList = [ lfn for lfn in lfnList if lfn not in metaDatas[\"Failed\"] ]\n-\n-  if not lfnList:\n-    gLogger.error( \"LFN list is empty!!!\" )\n-    DIRAC.exit( -1 )\n-\n-  if len( lfnList ) > Operation.MAX_FILES:\n-    gLogger.error( \"too many LFNs, max number of files per operation is %s\" % Operation.MAX_FILES )\n-    DIRAC.exit( -1 )\n-\n-  request = Request()\n-  request.RequestName = requestName\n-\n-  replicateAndRegister = Operation()\n-  replicateAndRegister.Type = \"ReplicateAndRegister\"\n-  replicateAndRegister.TargetSE = \",\".join( targetSEs )\n-\n-  for lfn in lfnList:\n-    metaDict = metaDatas[\"Successful\"][lfn]\n-    opFile = File()\n-    opFile.LFN = lfn\n-    opFile.Size = metaDict[\"Size\"]\n-\n-    if \"Checksum\" in metaDict:\n-      # # should check checksum type, now assuming Adler32 (metaDict[\"ChecksumType\"] = 'AD'\n-      opFile.Checksum = metaDict[\"Checksum\"]\n-      opFile.ChecksumType = \"ADLER32\"\n-    replicateAndRegister.addFile( opFile )\n-\n-  request.addOperation( replicateAndRegister )\n+  lfnChunks = breakListIntoChunks( lfnList, 100 )\n+  multiRequests = len( lfnChunks ) > 1\n \n+  error = 0","path":"DataManagementSystem/scripts/dirac-dms-replicate-and-register-request.py","position":97,"original_position":97,"commit_id":"8f2c7af34020e3213b9737966a10086681f85f57","original_commit_id":"11d22d89f38ecc9a94b440009307240a3a9f325c","user":{"login":"phicharp","id":792975,"avatar_url":"https://avatars.githubusercontent.com/u/792975?v=3","gravatar_id":"","url":"https://api.github.com/users/phicharp","html_url":"https://github.com/phicharp","followers_url":"https://api.github.com/users/phicharp/followers","following_url":"https://api.github.com/users/phicharp/following{/other_user}","gists_url":"https://api.github.com/users/phicharp/gists{/gist_id}","starred_url":"https://api.github.com/users/phicharp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phicharp/subscriptions","organizations_url":"https://api.github.com/users/phicharp/orgs","repos_url":"https://api.github.com/users/phicharp/repos","events_url":"https://api.github.com/users/phicharp/events{/privacy}","received_events_url":"https://api.github.com/users/phicharp/received_events","type":"User","site_admin":false},"body":"Right, I forgot to DIRAC.exit(error)   ;-)","created_at":"2015-08-03T15:45:38Z","updated_at":"2015-08-03T15:45:38Z","html_url":"https://github.com/DIRACGrid/DIRAC/pull/2518#discussion_r36098407","pull_request_url":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/2518","_links":{"self":{"href":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/comments/36098407"},"html":{"href":"https://github.com/DIRACGrid/DIRAC/pull/2518#discussion_r36098407"},"pull_request":{"href":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/2518"}}},"pull_request":{"url":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/2518","id":41226797,"html_url":"https://github.com/DIRACGrid/DIRAC/pull/2518","diff_url":"https://github.com/DIRACGrid/DIRAC/pull/2518.diff","patch_url":"https://github.com/DIRACGrid/DIRAC/pull/2518.patch","issue_url":"https://api.github.com/repos/DIRACGrid/DIRAC/issues/2518","number":2518,"state":"open","locked":false,"title":"[v6r13] Various fixes to TimeLeft, DFC, RMS","user":{"login":"phicharp","id":792975,"avatar_url":"https://avatars.githubusercontent.com/u/792975?v=3","gravatar_id":"","url":"https://api.github.com/users/phicharp","html_url":"https://github.com/phicharp","followers_url":"https://api.github.com/users/phicharp/followers","following_url":"https://api.github.com/users/phicharp/following{/other_user}","gists_url":"https://api.github.com/users/phicharp/gists{/gist_id}","starred_url":"https://api.github.com/users/phicharp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phicharp/subscriptions","organizations_url":"https://api.github.com/users/phicharp/orgs","repos_url":"https://api.github.com/users/phicharp/repos","events_url":"https://api.github.com/users/phicharp/events{/privacy}","received_events_url":"https://api.github.com/users/phicharp/received_events","type":"User","site_admin":false},"body":"* Improve dirac-dms-replicate-and-replister-request script to allow large number of files\r\n* Fix a very old bug in DFC (was returning OwmerDGroup instead of OwnerGroup)\r\n* Pass directory name to getDirectoryMetadata and not file name (which was working in LFC plugin)\r\n* LSF is setting shell variables, not envioronment variables, therefore added an \"export\" command to get the relevant variable and extract then the correct normalisation\r\n* Review / beautify code in TimeLeft and LSFTimeLEFT\r\n","created_at":"2015-07-30T12:12:58Z","updated_at":"2015-08-03T15:45:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ed161316cc44704dd1b5b6d7448a67601230ac12","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/2518/commits","review_comments_url":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/2518/comments","review_comment_url":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DIRACGrid/DIRAC/issues/2518/comments","statuses_url":"https://api.github.com/repos/DIRACGrid/DIRAC/statuses/8f2c7af34020e3213b9737966a10086681f85f57","head":{"label":"phicharp:v6r13-PhC-150729","ref":"v6r13-PhC-150729","sha":"8f2c7af34020e3213b9737966a10086681f85f57","user":{"login":"phicharp","id":792975,"avatar_url":"https://avatars.githubusercontent.com/u/792975?v=3","gravatar_id":"","url":"https://api.github.com/users/phicharp","html_url":"https://github.com/phicharp","followers_url":"https://api.github.com/users/phicharp/followers","following_url":"https://api.github.com/users/phicharp/following{/other_user}","gists_url":"https://api.github.com/users/phicharp/gists{/gist_id}","starred_url":"https://api.github.com/users/phicharp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phicharp/subscriptions","organizations_url":"https://api.github.com/users/phicharp/orgs","repos_url":"https://api.github.com/users/phicharp/repos","events_url":"https://api.github.com/users/phicharp/events{/privacy}","received_events_url":"https://api.github.com/users/phicharp/received_events","type":"User","site_admin":false},"repo":{"id":1759999,"name":"DIRAC","full_name":"phicharp/DIRAC","owner":{"login":"phicharp","id":792975,"avatar_url":"https://avatars.githubusercontent.com/u/792975?v=3","gravatar_id":"","url":"https://api.github.com/users/phicharp","html_url":"https://github.com/phicharp","followers_url":"https://api.github.com/users/phicharp/followers","following_url":"https://api.github.com/users/phicharp/following{/other_user}","gists_url":"https://api.github.com/users/phicharp/gists{/gist_id}","starred_url":"https://api.github.com/users/phicharp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phicharp/subscriptions","organizations_url":"https://api.github.com/users/phicharp/orgs","repos_url":"https://api.github.com/users/phicharp/repos","events_url":"https://api.github.com/users/phicharp/events{/privacy}","received_events_url":"https://api.github.com/users/phicharp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/phicharp/DIRAC","description":"DIRAC Grid","fork":true,"url":"https://api.github.com/repos/phicharp/DIRAC","forks_url":"https://api.github.com/repos/phicharp/DIRAC/forks","keys_url":"https://api.github.com/repos/phicharp/DIRAC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phicharp/DIRAC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phicharp/DIRAC/teams","hooks_url":"https://api.github.com/repos/phicharp/DIRAC/hooks","issue_events_url":"https://api.github.com/repos/phicharp/DIRAC/issues/events{/number}","events_url":"https://api.github.com/repos/phicharp/DIRAC/events","assignees_url":"https://api.github.com/repos/phicharp/DIRAC/assignees{/user}","branches_url":"https://api.github.com/repos/phicharp/DIRAC/branches{/branch}","tags_url":"https://api.github.com/repos/phicharp/DIRAC/tags","blobs_url":"https://api.github.com/repos/phicharp/DIRAC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phicharp/DIRAC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phicharp/DIRAC/git/refs{/sha}","trees_url":"https://api.github.com/repos/phicharp/DIRAC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phicharp/DIRAC/statuses/{sha}","languages_url":"https://api.github.com/repos/phicharp/DIRAC/languages","stargazers_url":"https://api.github.com/repos/phicharp/DIRAC/stargazers","contributors_url":"https://api.github.com/repos/phicharp/DIRAC/contributors","subscribers_url":"https://api.github.com/repos/phicharp/DIRAC/subscribers","subscription_url":"https://api.github.com/repos/phicharp/DIRAC/subscription","commits_url":"https://api.github.com/repos/phicharp/DIRAC/commits{/sha}","git_commits_url":"https://api.github.com/repos/phicharp/DIRAC/git/commits{/sha}","comments_url":"https://api.github.com/repos/phicharp/DIRAC/comments{/number}","issue_comment_url":"https://api.github.com/repos/phicharp/DIRAC/issues/comments{/number}","contents_url":"https://api.github.com/repos/phicharp/DIRAC/contents/{+path}","compare_url":"https://api.github.com/repos/phicharp/DIRAC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phicharp/DIRAC/merges","archive_url":"https://api.github.com/repos/phicharp/DIRAC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phicharp/DIRAC/downloads","issues_url":"https://api.github.com/repos/phicharp/DIRAC/issues{/number}","pulls_url":"https://api.github.com/repos/phicharp/DIRAC/pulls{/number}","milestones_url":"https://api.github.com/repos/phicharp/DIRAC/milestones{/number}","notifications_url":"https://api.github.com/repos/phicharp/DIRAC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phicharp/DIRAC/labels{/name}","releases_url":"https://api.github.com/repos/phicharp/DIRAC/releases{/id}","created_at":"2011-05-17T09:10:18Z","updated_at":"2014-06-23T16:24:37Z","pushed_at":"2015-08-03T15:27:23Z","git_url":"git://github.com/phicharp/DIRAC.git","ssh_url":"git@github.com:phicharp/DIRAC.git","clone_url":"https://github.com/phicharp/DIRAC.git","svn_url":"https://github.com/phicharp/DIRAC","homepage":"http://diracgrid.org","size":25736,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"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":1,"default_branch":"integration"}},"base":{"label":"DIRACGrid:rel-v6r13","ref":"rel-v6r13","sha":"c00eeb682e0d06d74f0ae5c44474181874163c4c","user":{"login":"DIRACGrid","id":694842,"avatar_url":"https://avatars.githubusercontent.com/u/694842?v=3","gravatar_id":"","url":"https://api.github.com/users/DIRACGrid","html_url":"https://github.com/DIRACGrid","followers_url":"https://api.github.com/users/DIRACGrid/followers","following_url":"https://api.github.com/users/DIRACGrid/following{/other_user}","gists_url":"https://api.github.com/users/DIRACGrid/gists{/gist_id}","starred_url":"https://api.github.com/users/DIRACGrid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DIRACGrid/subscriptions","organizations_url":"https://api.github.com/users/DIRACGrid/orgs","repos_url":"https://api.github.com/users/DIRACGrid/repos","events_url":"https://api.github.com/users/DIRACGrid/events{/privacy}","received_events_url":"https://api.github.com/users/DIRACGrid/received_events","type":"Organization","site_admin":false},"repo":{"id":1576831,"name":"DIRAC","full_name":"DIRACGrid/DIRAC","owner":{"login":"DIRACGrid","id":694842,"avatar_url":"https://avatars.githubusercontent.com/u/694842?v=3","gravatar_id":"","url":"https://api.github.com/users/DIRACGrid","html_url":"https://github.com/DIRACGrid","followers_url":"https://api.github.com/users/DIRACGrid/followers","following_url":"https://api.github.com/users/DIRACGrid/following{/other_user}","gists_url":"https://api.github.com/users/DIRACGrid/gists{/gist_id}","starred_url":"https://api.github.com/users/DIRACGrid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DIRACGrid/subscriptions","organizations_url":"https://api.github.com/users/DIRACGrid/orgs","repos_url":"https://api.github.com/users/DIRACGrid/repos","events_url":"https://api.github.com/users/DIRACGrid/events{/privacy}","received_events_url":"https://api.github.com/users/DIRACGrid/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DIRACGrid/DIRAC","description":"DIRAC Grid","fork":false,"url":"https://api.github.com/repos/DIRACGrid/DIRAC","forks_url":"https://api.github.com/repos/DIRACGrid/DIRAC/forks","keys_url":"https://api.github.com/repos/DIRACGrid/DIRAC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DIRACGrid/DIRAC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DIRACGrid/DIRAC/teams","hooks_url":"https://api.github.com/repos/DIRACGrid/DIRAC/hooks","issue_events_url":"https://api.github.com/repos/DIRACGrid/DIRAC/issues/events{/number}","events_url":"https://api.github.com/repos/DIRACGrid/DIRAC/events","assignees_url":"https://api.github.com/repos/DIRACGrid/DIRAC/assignees{/user}","branches_url":"https://api.github.com/repos/DIRACGrid/DIRAC/branches{/branch}","tags_url":"https://api.github.com/repos/DIRACGrid/DIRAC/tags","blobs_url":"https://api.github.com/repos/DIRACGrid/DIRAC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DIRACGrid/DIRAC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DIRACGrid/DIRAC/git/refs{/sha}","trees_url":"https://api.github.com/repos/DIRACGrid/DIRAC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DIRACGrid/DIRAC/statuses/{sha}","languages_url":"https://api.github.com/repos/DIRACGrid/DIRAC/languages","stargazers_url":"https://api.github.com/repos/DIRACGrid/DIRAC/stargazers","contributors_url":"https://api.github.com/repos/DIRACGrid/DIRAC/contributors","subscribers_url":"https://api.github.com/repos/DIRACGrid/DIRAC/subscribers","subscription_url":"https://api.github.com/repos/DIRACGrid/DIRAC/subscription","commits_url":"https://api.github.com/repos/DIRACGrid/DIRAC/commits{/sha}","git_commits_url":"https://api.github.com/repos/DIRACGrid/DIRAC/git/commits{/sha}","comments_url":"https://api.github.com/repos/DIRACGrid/DIRAC/comments{/number}","issue_comment_url":"https://api.github.com/repos/DIRACGrid/DIRAC/issues/comments{/number}","contents_url":"https://api.github.com/repos/DIRACGrid/DIRAC/contents/{+path}","compare_url":"https://api.github.com/repos/DIRACGrid/DIRAC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DIRACGrid/DIRAC/merges","archive_url":"https://api.github.com/repos/DIRACGrid/DIRAC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DIRACGrid/DIRAC/downloads","issues_url":"https://api.github.com/repos/DIRACGrid/DIRAC/issues{/number}","pulls_url":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls{/number}","milestones_url":"https://api.github.com/repos/DIRACGrid/DIRAC/milestones{/number}","notifications_url":"https://api.github.com/repos/DIRACGrid/DIRAC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DIRACGrid/DIRAC/labels{/name}","releases_url":"https://api.github.com/repos/DIRACGrid/DIRAC/releases{/id}","created_at":"2011-04-06T11:47:53Z","updated_at":"2015-07-08T16:27:58Z","pushed_at":"2015-08-03T15:27:24Z","git_url":"git://github.com/DIRACGrid/DIRAC.git","ssh_url":"git@github.com:DIRACGrid/DIRAC.git","clone_url":"https://github.com/DIRACGrid/DIRAC.git","svn_url":"https://github.com/DIRACGrid/DIRAC","homepage":"http://diracgrid.org","size":63900,"stargazers_count":43,"watchers_count":43,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":82,"mirror_url":null,"open_issues_count":122,"forks":82,"open_issues":122,"watchers":43,"default_branch":"integration"}},"_links":{"self":{"href":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/2518"},"html":{"href":"https://github.com/DIRACGrid/DIRAC/pull/2518"},"issue":{"href":"https://api.github.com/repos/DIRACGrid/DIRAC/issues/2518"},"comments":{"href":"https://api.github.com/repos/DIRACGrid/DIRAC/issues/2518/comments"},"review_comments":{"href":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/2518/comments"},"review_comment":{"href":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DIRACGrid/DIRAC/pulls/2518/commits"},"statuses":{"href":"https://api.github.com/repos/DIRACGrid/DIRAC/statuses/8f2c7af34020e3213b9737966a10086681f85f57"}}}}