{"action":"created","comment":{"url":"https://api.github.com/repos/Normation/rudder-packages/pulls/comments/82628644","pull_request_review_id":3522802,"id":82628644,"diff_hunk":"@@ -0,0 +1,139 @@\n+Fixes #9278: Add Timezone information in inventory\n+\n+https://www.rudder-project.org/redmine/issues/9278\n+\n+--- a/README\n++++ b/README\n+@@ -40,6 +40,8 @@\n+ \n+ * Net::CUPS, for printers detection\n+ * Parse::EDID, for EDID data parsing\n++* DateTime, DateTime::TimeZone and DateTime::TimeZone::Local::{Win32,Unix}\n++  for reliable timezone name extraction \n+ \n+ Optional programs:\n+ \n+--- a/Makefile.PL\n++++ b/Makefile.PL\n+@@ -59,6 +59,10 @@\n+ # Inventory\n+ recommends 'Parse::EDID' => '0';\n+ recommends 'Net::CUPS'   => 0.60 if $OSNAME ne 'MSWin32';\n++recommends 'DateTime'                         => '0';\n++recommends 'DateTime::TimeZone'               => '0';\n++recommends 'DateTime::TimeZone::Local::Unix'  => '0' if $OSNAME ne 'MSWin32';\n++recommends 'DateTime::TimeZone::Local::Win32' => '0' if $OSNAME eq 'MSWin32';\n+ \n+ # Deploy\n+ recommends 'Archive::Extract'             => '0';\n+--- a/lib/FusionInventory/Agent/Inventory.pm\n++++ b/lib/FusionInventory/Agent/Inventory.pm\n+@@ -25,7 +25,7 @@\n+                              VMNAME VMHOSTSERIAL/ ],\n+     OPERATINGSYSTEM  => [ qw/KERNEL_NAME KERNEL_VERSION NAME VERSION FULL_NAME\n+                              SERVICE_PACK INSTALL_DATE FQDN DNS_DOMAIN\n+-                             SSH_KEY ARCH BOOT_TIME/ ],\n++                             SSH_KEY ARCH BOOT_TIME TIMEZONE/ ],\n+     ACCESSLOG        => [ qw/USERID LOGDATE/ ],\n+ \n+     ANTIVIRUS        => [ qw/COMPANY ENABLED GUID NAME UPTODATE VERSION/ ],\n+--- /dev/null\t2016-10-06 11:58:32.025981414 +0200\n++++ b/lib/FusionInventory/Agent/Task/Inventory/Generic/Timezone.pm\t2016-10-07 17:25:35.261739989 +0200\n+@@ -0,0 +1,97 @@\n++package FusionInventory::Agent::Task::Inventory::Generic::Timezone;\n++\n++use strict;\n++use warnings;\n++\n++use English qw(-no_match_vars);\n++use UNIVERSAL::require;\n++\n++use POSIX;\n++use Time::Local;\n++\n++use FusionInventory::Agent::Tools;\n++\n++my $seen;\n++\n++sub isEnabled {\n++\n++    # No specific dependencies necessary\n++    return 1;\n++}\n++\n++sub doInventory {\n++    my (%params) = @_;\n++\n++    my $inventory = $params{inventory};\n++    my $logger    = $params{logger};\n++\n++    # Compute a timezone offset like '+0200' using the difference between UTC and local time\n++    # Might require merging with detectLocalTimeOffset (macOS inventory) in the future\n++\n++    ## Get the local time\n++    my @t = localtime(time);\n++\n++    ## Compute the time offset in seconds between local and UTC time (relative and absolute)\n++    my $utc_offset_seconds     = timegm(@t) - timelocal(@t);\n++    my $utc_offset_seconds_abs = abs($utc_offset_seconds);\n++\n++    ## If relative and absolute values do not match, it means the offset is negative\n++    my $offset_sign =","path":"rudder-agent/SOURCES/patches/fusioninventory/0023-Fixes-9278-add-timezone-information-to-inventory.patch","position":81,"original_position":81,"commit_id":"a59889a72ef5b023cd164aa3fad76df1e2b61b9c","original_commit_id":"a59889a72ef5b023cd164aa3fad76df1e2b61b9c","user":{"login":"peckpeck","id":7976666,"avatar_url":"https://avatars.githubusercontent.com/u/7976666?v=3","gravatar_id":"","url":"https://api.github.com/users/peckpeck","html_url":"https://github.com/peckpeck","followers_url":"https://api.github.com/users/peckpeck/followers","following_url":"https://api.github.com/users/peckpeck/following{/other_user}","gists_url":"https://api.github.com/users/peckpeck/gists{/gist_id}","starred_url":"https://api.github.com/users/peckpeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peckpeck/subscriptions","organizations_url":"https://api.github.com/users/peckpeck/orgs","repos_url":"https://api.github.com/users/peckpeck/repos","events_url":"https://api.github.com/users/peckpeck/events{/privacy}","received_events_url":"https://api.github.com/users/peckpeck/received_events","type":"User","site_admin":false},"body":"why not just compare the value to 0 ?","created_at":"2016-10-10T15:37:27Z","updated_at":"2016-10-10T15:37:27Z","html_url":"https://github.com/Normation/rudder-packages/pull/1100#discussion_r82628644","pull_request_url":"https://api.github.com/repos/Normation/rudder-packages/pulls/1100","_links":{"self":{"href":"https://api.github.com/repos/Normation/rudder-packages/pulls/comments/82628644"},"html":{"href":"https://github.com/Normation/rudder-packages/pull/1100#discussion_r82628644"},"pull_request":{"href":"https://api.github.com/repos/Normation/rudder-packages/pulls/1100"}}},"pull_request":{"url":"https://api.github.com/repos/Normation/rudder-packages/pulls/1100","id":88476834,"html_url":"https://github.com/Normation/rudder-packages/pull/1100","diff_url":"https://github.com/Normation/rudder-packages/pull/1100.diff","patch_url":"https://github.com/Normation/rudder-packages/pull/1100.patch","issue_url":"https://api.github.com/repos/Normation/rudder-packages/issues/1100","number":1100,"state":"open","locked":false,"title":"Fixes #7093: Include Timezone in Inventory","user":{"login":"Kegeruneku","id":917886,"avatar_url":"https://avatars.githubusercontent.com/u/917886?v=3","gravatar_id":"","url":"https://api.github.com/users/Kegeruneku","html_url":"https://github.com/Kegeruneku","followers_url":"https://api.github.com/users/Kegeruneku/followers","following_url":"https://api.github.com/users/Kegeruneku/following{/other_user}","gists_url":"https://api.github.com/users/Kegeruneku/gists{/gist_id}","starred_url":"https://api.github.com/users/Kegeruneku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kegeruneku/subscriptions","organizations_url":"https://api.github.com/users/Kegeruneku/orgs","repos_url":"https://api.github.com/users/Kegeruneku/repos","events_url":"https://api.github.com/users/Kegeruneku/events{/privacy}","received_events_url":"https://api.github.com/users/Kegeruneku/received_events","type":"User","site_admin":false},"body":"https://www.rudder-project.org/redmine/issues/7093","created_at":"2016-10-07T17:26:15Z","updated_at":"2016-10-10T15:37:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"435c0df7346203ca45922382c336866ecf54ba51","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Normation/rudder-packages/pulls/1100/commits","review_comments_url":"https://api.github.com/repos/Normation/rudder-packages/pulls/1100/comments","review_comment_url":"https://api.github.com/repos/Normation/rudder-packages/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Normation/rudder-packages/issues/1100/comments","statuses_url":"https://api.github.com/repos/Normation/rudder-packages/statuses/a59889a72ef5b023cd164aa3fad76df1e2b61b9c","head":{"label":"Kegeruneku:ust_7093/include_timezone_in_inventory","ref":"ust_7093/include_timezone_in_inventory","sha":"a59889a72ef5b023cd164aa3fad76df1e2b61b9c","user":{"login":"Kegeruneku","id":917886,"avatar_url":"https://avatars.githubusercontent.com/u/917886?v=3","gravatar_id":"","url":"https://api.github.com/users/Kegeruneku","html_url":"https://github.com/Kegeruneku","followers_url":"https://api.github.com/users/Kegeruneku/followers","following_url":"https://api.github.com/users/Kegeruneku/following{/other_user}","gists_url":"https://api.github.com/users/Kegeruneku/gists{/gist_id}","starred_url":"https://api.github.com/users/Kegeruneku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kegeruneku/subscriptions","organizations_url":"https://api.github.com/users/Kegeruneku/orgs","repos_url":"https://api.github.com/users/Kegeruneku/repos","events_url":"https://api.github.com/users/Kegeruneku/events{/privacy}","received_events_url":"https://api.github.com/users/Kegeruneku/received_events","type":"User","site_admin":false},"repo":{"id":30084163,"name":"rudder-packages","full_name":"Kegeruneku/rudder-packages","owner":{"login":"Kegeruneku","id":917886,"avatar_url":"https://avatars.githubusercontent.com/u/917886?v=3","gravatar_id":"","url":"https://api.github.com/users/Kegeruneku","html_url":"https://github.com/Kegeruneku","followers_url":"https://api.github.com/users/Kegeruneku/followers","following_url":"https://api.github.com/users/Kegeruneku/following{/other_user}","gists_url":"https://api.github.com/users/Kegeruneku/gists{/gist_id}","starred_url":"https://api.github.com/users/Kegeruneku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kegeruneku/subscriptions","organizations_url":"https://api.github.com/users/Kegeruneku/orgs","repos_url":"https://api.github.com/users/Kegeruneku/repos","events_url":"https://api.github.com/users/Kegeruneku/events{/privacy}","received_events_url":"https://api.github.com/users/Kegeruneku/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Kegeruneku/rudder-packages","description":"","fork":true,"url":"https://api.github.com/repos/Kegeruneku/rudder-packages","forks_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/forks","keys_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/teams","hooks_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/hooks","issue_events_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/issues/events{/number}","events_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/events","assignees_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/assignees{/user}","branches_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/branches{/branch}","tags_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/tags","blobs_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/statuses/{sha}","languages_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/languages","stargazers_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/stargazers","contributors_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/contributors","subscribers_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/subscribers","subscription_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/subscription","commits_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/contents/{+path}","compare_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/merges","archive_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/downloads","issues_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/issues{/number}","pulls_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/pulls{/number}","milestones_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/milestones{/number}","notifications_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/labels{/name}","releases_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/releases{/id}","deployments_url":"https://api.github.com/repos/Kegeruneku/rudder-packages/deployments","created_at":"2015-01-30T18:00:15Z","updated_at":"2016-09-27T13:34:07Z","pushed_at":"2016-10-07T17:26:14Z","git_url":"git://github.com/Kegeruneku/rudder-packages.git","ssh_url":"git@github.com:Kegeruneku/rudder-packages.git","clone_url":"https://github.com/Kegeruneku/rudder-packages.git","svn_url":"https://github.com/Kegeruneku/rudder-packages","homepage":"http://www.rudder-project.org/","size":5543,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"Normation:master","ref":"master","sha":"b0fc668431917d4f797dec81a1c8417a18baaa21","user":{"login":"Normation","id":695105,"avatar_url":"https://avatars.githubusercontent.com/u/695105?v=3","gravatar_id":"","url":"https://api.github.com/users/Normation","html_url":"https://github.com/Normation","followers_url":"https://api.github.com/users/Normation/followers","following_url":"https://api.github.com/users/Normation/following{/other_user}","gists_url":"https://api.github.com/users/Normation/gists{/gist_id}","starred_url":"https://api.github.com/users/Normation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Normation/subscriptions","organizations_url":"https://api.github.com/users/Normation/orgs","repos_url":"https://api.github.com/users/Normation/repos","events_url":"https://api.github.com/users/Normation/events{/privacy}","received_events_url":"https://api.github.com/users/Normation/received_events","type":"Organization","site_admin":false},"repo":{"id":2528278,"name":"rudder-packages","full_name":"Normation/rudder-packages","owner":{"login":"Normation","id":695105,"avatar_url":"https://avatars.githubusercontent.com/u/695105?v=3","gravatar_id":"","url":"https://api.github.com/users/Normation","html_url":"https://github.com/Normation","followers_url":"https://api.github.com/users/Normation/followers","following_url":"https://api.github.com/users/Normation/following{/other_user}","gists_url":"https://api.github.com/users/Normation/gists{/gist_id}","starred_url":"https://api.github.com/users/Normation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Normation/subscriptions","organizations_url":"https://api.github.com/users/Normation/orgs","repos_url":"https://api.github.com/users/Normation/repos","events_url":"https://api.github.com/users/Normation/events{/privacy}","received_events_url":"https://api.github.com/users/Normation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Normation/rudder-packages","description":"","fork":false,"url":"https://api.github.com/repos/Normation/rudder-packages","forks_url":"https://api.github.com/repos/Normation/rudder-packages/forks","keys_url":"https://api.github.com/repos/Normation/rudder-packages/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Normation/rudder-packages/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Normation/rudder-packages/teams","hooks_url":"https://api.github.com/repos/Normation/rudder-packages/hooks","issue_events_url":"https://api.github.com/repos/Normation/rudder-packages/issues/events{/number}","events_url":"https://api.github.com/repos/Normation/rudder-packages/events","assignees_url":"https://api.github.com/repos/Normation/rudder-packages/assignees{/user}","branches_url":"https://api.github.com/repos/Normation/rudder-packages/branches{/branch}","tags_url":"https://api.github.com/repos/Normation/rudder-packages/tags","blobs_url":"https://api.github.com/repos/Normation/rudder-packages/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Normation/rudder-packages/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Normation/rudder-packages/git/refs{/sha}","trees_url":"https://api.github.com/repos/Normation/rudder-packages/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Normation/rudder-packages/statuses/{sha}","languages_url":"https://api.github.com/repos/Normation/rudder-packages/languages","stargazers_url":"https://api.github.com/repos/Normation/rudder-packages/stargazers","contributors_url":"https://api.github.com/repos/Normation/rudder-packages/contributors","subscribers_url":"https://api.github.com/repos/Normation/rudder-packages/subscribers","subscription_url":"https://api.github.com/repos/Normation/rudder-packages/subscription","commits_url":"https://api.github.com/repos/Normation/rudder-packages/commits{/sha}","git_commits_url":"https://api.github.com/repos/Normation/rudder-packages/git/commits{/sha}","comments_url":"https://api.github.com/repos/Normation/rudder-packages/comments{/number}","issue_comment_url":"https://api.github.com/repos/Normation/rudder-packages/issues/comments{/number}","contents_url":"https://api.github.com/repos/Normation/rudder-packages/contents/{+path}","compare_url":"https://api.github.com/repos/Normation/rudder-packages/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Normation/rudder-packages/merges","archive_url":"https://api.github.com/repos/Normation/rudder-packages/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Normation/rudder-packages/downloads","issues_url":"https://api.github.com/repos/Normation/rudder-packages/issues{/number}","pulls_url":"https://api.github.com/repos/Normation/rudder-packages/pulls{/number}","milestones_url":"https://api.github.com/repos/Normation/rudder-packages/milestones{/number}","notifications_url":"https://api.github.com/repos/Normation/rudder-packages/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Normation/rudder-packages/labels{/name}","releases_url":"https://api.github.com/repos/Normation/rudder-packages/releases{/id}","deployments_url":"https://api.github.com/repos/Normation/rudder-packages/deployments","created_at":"2011-10-06T19:30:49Z","updated_at":"2016-08-23T09:25:32Z","pushed_at":"2016-10-07T21:05:00Z","git_url":"git://github.com/Normation/rudder-packages.git","ssh_url":"git@github.com:Normation/rudder-packages.git","clone_url":"https://github.com/Normation/rudder-packages.git","svn_url":"https://github.com/Normation/rudder-packages","homepage":"http://www.rudder-project.org/","size":5817,"stargazers_count":4,"watchers_count":4,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":7,"forks":18,"open_issues":7,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Normation/rudder-packages/pulls/1100"},"html":{"href":"https://github.com/Normation/rudder-packages/pull/1100"},"issue":{"href":"https://api.github.com/repos/Normation/rudder-packages/issues/1100"},"comments":{"href":"https://api.github.com/repos/Normation/rudder-packages/issues/1100/comments"},"review_comments":{"href":"https://api.github.com/repos/Normation/rudder-packages/pulls/1100/comments"},"review_comment":{"href":"https://api.github.com/repos/Normation/rudder-packages/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Normation/rudder-packages/pulls/1100/commits"},"statuses":{"href":"https://api.github.com/repos/Normation/rudder-packages/statuses/a59889a72ef5b023cd164aa3fad76df1e2b61b9c"}}}}
{"actor":{"display_login":"peckpeck"}}