[24/50] [abbrv] ambari git commit: AMBARI-20787. Ambari agent should log how it determines it's FQDN. (stoader)

2017-04-24 Thread aonishuk
AMBARI-20787. Ambari agent should log how it determines it's FQDN. (stoader)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/53dcaa8d
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/53dcaa8d
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/53dcaa8d

Branch: refs/heads/branch-3.0-perf
Commit: 53dcaa8d2c3b401f47a258c73398ef8746a230f6
Parents: 8ead189
Author: Toader, Sebastian 
Authored: Fri Apr 21 08:11:31 2017 +0200
Committer: Andrew Onishuk 
Committed: Mon Apr 24 14:59:56 2017 +0300

--
 ambari-agent/src/main/python/ambari_agent/Hardware.py | 2 ++
 ambari-agent/src/main/python/ambari_agent/hostname.py | 8 
 2 files changed, 10 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/53dcaa8d/ambari-agent/src/main/python/ambari_agent/Hardware.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/Hardware.py 
b/ambari-agent/src/main/python/ambari_agent/Hardware.py
index 8cb8a28..696438e 100644
--- a/ambari-agent/src/main/python/ambari_agent/Hardware.py
+++ b/ambari-agent/src/main/python/ambari_agent/Hardware.py
@@ -45,11 +45,13 @@ class Hardware:
   LINUX_PATH_SEP = "/"
 
   def __init__(self, config):
+logger.info("Initializing host system information.")
 self.hardware = {
   'mounts': Hardware.osdisks()
 }
 self.config = config
 self.hardware.update(Facter(self.config).facterInfo())
+logger.info("Host system information: %s", self.hardware)
 
   @classmethod
   def _parse_df_line(cls, line):

http://git-wip-us.apache.org/repos/asf/ambari/blob/53dcaa8d/ambari-agent/src/main/python/ambari_agent/hostname.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/hostname.py 
b/ambari-agent/src/main/python/ambari_agent/hostname.py
index 0f5f069..357c6b0 100644
--- a/ambari-agent/src/main/python/ambari_agent/hostname.py
+++ b/ambari-agent/src/main/python/ambari_agent/hostname.py
@@ -23,6 +23,7 @@ import subprocess
 import urllib2
 import logging
 import traceback
+import sys
 
 logger = logging.getLogger(__name__)
 
@@ -52,12 +53,19 @@ def hostname(config):
   out, err = osStat.communicate()
   if (0 == osStat.returncode and 0 != len(out.strip())):
 cached_hostname = out.strip()
+logger.info("Read hostname '{0}' using agent:hostname_script 
'{1}'".format(cached_hostname, scriptname))
   else:
+logger.warn("Execution of '{0}' failed with exit code {1}. 
err='{2}'\nout='{3}'".format(scriptname, osStat.returncode, err.strip(), 
out.strip()))
 cached_hostname = socket.getfqdn()
+logger.info("Read hostname '{0}' using socket.getfqdn() as '{1}' 
failed".format(cached_hostname, scriptname))
 except:
   cached_hostname = socket.getfqdn()
+  logger.warn("Unexpected error while retrieving hostname: '{0}', 
defaulting to socket.getfqdn()".format(sys.exc_info()))
+  logger.info("Read hostname '{0}' using 
socket.getfqdn().".format(cached_hostname))
   except:
 cached_hostname = socket.getfqdn()
+logger.info("agent:hostname_script configuration not defined thus read 
hostname '{0}' using socket.getfqdn().".format(cached_hostname))
+
   cached_hostname = cached_hostname.lower()
   return cached_hostname
 



[17/45] ambari git commit: AMBARI-20787. Ambari agent should log how it determines it's FQDN. (stoader)

2017-04-23 Thread jonathanhurley
AMBARI-20787. Ambari agent should log how it determines it's FQDN. (stoader)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ad4e11cc
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ad4e11cc
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ad4e11cc

Branch: refs/heads/branch-feature-AMBARI-12556
Commit: ad4e11cc0cdfe33bdb33008b4b7586e55b9cd715
Parents: 2075f52
Author: Toader, Sebastian 
Authored: Fri Apr 21 08:11:31 2017 +0200
Committer: Toader, Sebastian 
Committed: Fri Apr 21 08:11:31 2017 +0200

--
 ambari-agent/src/main/python/ambari_agent/Hardware.py | 2 ++
 ambari-agent/src/main/python/ambari_agent/hostname.py | 8 
 2 files changed, 10 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ad4e11cc/ambari-agent/src/main/python/ambari_agent/Hardware.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/Hardware.py 
b/ambari-agent/src/main/python/ambari_agent/Hardware.py
index 8cb8a28..696438e 100644
--- a/ambari-agent/src/main/python/ambari_agent/Hardware.py
+++ b/ambari-agent/src/main/python/ambari_agent/Hardware.py
@@ -45,11 +45,13 @@ class Hardware:
   LINUX_PATH_SEP = "/"
 
   def __init__(self, config):
+logger.info("Initializing host system information.")
 self.hardware = {
   'mounts': Hardware.osdisks()
 }
 self.config = config
 self.hardware.update(Facter(self.config).facterInfo())
+logger.info("Host system information: %s", self.hardware)
 
   @classmethod
   def _parse_df_line(cls, line):

http://git-wip-us.apache.org/repos/asf/ambari/blob/ad4e11cc/ambari-agent/src/main/python/ambari_agent/hostname.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/hostname.py 
b/ambari-agent/src/main/python/ambari_agent/hostname.py
index 0f5f069..357c6b0 100644
--- a/ambari-agent/src/main/python/ambari_agent/hostname.py
+++ b/ambari-agent/src/main/python/ambari_agent/hostname.py
@@ -23,6 +23,7 @@ import subprocess
 import urllib2
 import logging
 import traceback
+import sys
 
 logger = logging.getLogger(__name__)
 
@@ -52,12 +53,19 @@ def hostname(config):
   out, err = osStat.communicate()
   if (0 == osStat.returncode and 0 != len(out.strip())):
 cached_hostname = out.strip()
+logger.info("Read hostname '{0}' using agent:hostname_script 
'{1}'".format(cached_hostname, scriptname))
   else:
+logger.warn("Execution of '{0}' failed with exit code {1}. 
err='{2}'\nout='{3}'".format(scriptname, osStat.returncode, err.strip(), 
out.strip()))
 cached_hostname = socket.getfqdn()
+logger.info("Read hostname '{0}' using socket.getfqdn() as '{1}' 
failed".format(cached_hostname, scriptname))
 except:
   cached_hostname = socket.getfqdn()
+  logger.warn("Unexpected error while retrieving hostname: '{0}', 
defaulting to socket.getfqdn()".format(sys.exc_info()))
+  logger.info("Read hostname '{0}' using 
socket.getfqdn().".format(cached_hostname))
   except:
 cached_hostname = socket.getfqdn()
+logger.info("agent:hostname_script configuration not defined thus read 
hostname '{0}' using socket.getfqdn().".format(cached_hostname))
+
   cached_hostname = cached_hostname.lower()
   return cached_hostname
 



ambari git commit: AMBARI-20787. Ambari agent should log how it determines it's FQDN. (stoader)

2017-04-21 Thread stoader
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 c80dc4db1 -> 22a302765


AMBARI-20787. Ambari agent should log how it determines it's FQDN. (stoader)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/22a30276
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/22a30276
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/22a30276

Branch: refs/heads/branch-2.5
Commit: 22a30276553f1179ac40e1fa74e47d6d7b3b7155
Parents: c80dc4d
Author: Toader, Sebastian 
Authored: Fri Apr 21 08:11:31 2017 +0200
Committer: Toader, Sebastian 
Committed: Fri Apr 21 08:15:08 2017 +0200

--
 ambari-agent/src/main/python/ambari_agent/Hardware.py | 2 ++
 ambari-agent/src/main/python/ambari_agent/hostname.py | 8 
 2 files changed, 10 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/22a30276/ambari-agent/src/main/python/ambari_agent/Hardware.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/Hardware.py 
b/ambari-agent/src/main/python/ambari_agent/Hardware.py
index 8cb8a28..696438e 100644
--- a/ambari-agent/src/main/python/ambari_agent/Hardware.py
+++ b/ambari-agent/src/main/python/ambari_agent/Hardware.py
@@ -45,11 +45,13 @@ class Hardware:
   LINUX_PATH_SEP = "/"
 
   def __init__(self, config):
+logger.info("Initializing host system information.")
 self.hardware = {
   'mounts': Hardware.osdisks()
 }
 self.config = config
 self.hardware.update(Facter(self.config).facterInfo())
+logger.info("Host system information: %s", self.hardware)
 
   @classmethod
   def _parse_df_line(cls, line):

http://git-wip-us.apache.org/repos/asf/ambari/blob/22a30276/ambari-agent/src/main/python/ambari_agent/hostname.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/hostname.py 
b/ambari-agent/src/main/python/ambari_agent/hostname.py
index 0f5f069..357c6b0 100644
--- a/ambari-agent/src/main/python/ambari_agent/hostname.py
+++ b/ambari-agent/src/main/python/ambari_agent/hostname.py
@@ -23,6 +23,7 @@ import subprocess
 import urllib2
 import logging
 import traceback
+import sys
 
 logger = logging.getLogger(__name__)
 
@@ -52,12 +53,19 @@ def hostname(config):
   out, err = osStat.communicate()
   if (0 == osStat.returncode and 0 != len(out.strip())):
 cached_hostname = out.strip()
+logger.info("Read hostname '{0}' using agent:hostname_script 
'{1}'".format(cached_hostname, scriptname))
   else:
+logger.warn("Execution of '{0}' failed with exit code {1}. 
err='{2}'\nout='{3}'".format(scriptname, osStat.returncode, err.strip(), 
out.strip()))
 cached_hostname = socket.getfqdn()
+logger.info("Read hostname '{0}' using socket.getfqdn() as '{1}' 
failed".format(cached_hostname, scriptname))
 except:
   cached_hostname = socket.getfqdn()
+  logger.warn("Unexpected error while retrieving hostname: '{0}', 
defaulting to socket.getfqdn()".format(sys.exc_info()))
+  logger.info("Read hostname '{0}' using 
socket.getfqdn().".format(cached_hostname))
   except:
 cached_hostname = socket.getfqdn()
+logger.info("agent:hostname_script configuration not defined thus read 
hostname '{0}' using socket.getfqdn().".format(cached_hostname))
+
   cached_hostname = cached_hostname.lower()
   return cached_hostname
 



ambari git commit: AMBARI-20787. Ambari agent should log how it determines it's FQDN. (stoader)

2017-04-21 Thread stoader
Repository: ambari
Updated Branches:
  refs/heads/trunk 2075f52e3 -> ad4e11cc0


AMBARI-20787. Ambari agent should log how it determines it's FQDN. (stoader)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ad4e11cc
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ad4e11cc
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ad4e11cc

Branch: refs/heads/trunk
Commit: ad4e11cc0cdfe33bdb33008b4b7586e55b9cd715
Parents: 2075f52
Author: Toader, Sebastian 
Authored: Fri Apr 21 08:11:31 2017 +0200
Committer: Toader, Sebastian 
Committed: Fri Apr 21 08:11:31 2017 +0200

--
 ambari-agent/src/main/python/ambari_agent/Hardware.py | 2 ++
 ambari-agent/src/main/python/ambari_agent/hostname.py | 8 
 2 files changed, 10 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ad4e11cc/ambari-agent/src/main/python/ambari_agent/Hardware.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/Hardware.py 
b/ambari-agent/src/main/python/ambari_agent/Hardware.py
index 8cb8a28..696438e 100644
--- a/ambari-agent/src/main/python/ambari_agent/Hardware.py
+++ b/ambari-agent/src/main/python/ambari_agent/Hardware.py
@@ -45,11 +45,13 @@ class Hardware:
   LINUX_PATH_SEP = "/"
 
   def __init__(self, config):
+logger.info("Initializing host system information.")
 self.hardware = {
   'mounts': Hardware.osdisks()
 }
 self.config = config
 self.hardware.update(Facter(self.config).facterInfo())
+logger.info("Host system information: %s", self.hardware)
 
   @classmethod
   def _parse_df_line(cls, line):

http://git-wip-us.apache.org/repos/asf/ambari/blob/ad4e11cc/ambari-agent/src/main/python/ambari_agent/hostname.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/hostname.py 
b/ambari-agent/src/main/python/ambari_agent/hostname.py
index 0f5f069..357c6b0 100644
--- a/ambari-agent/src/main/python/ambari_agent/hostname.py
+++ b/ambari-agent/src/main/python/ambari_agent/hostname.py
@@ -23,6 +23,7 @@ import subprocess
 import urllib2
 import logging
 import traceback
+import sys
 
 logger = logging.getLogger(__name__)
 
@@ -52,12 +53,19 @@ def hostname(config):
   out, err = osStat.communicate()
   if (0 == osStat.returncode and 0 != len(out.strip())):
 cached_hostname = out.strip()
+logger.info("Read hostname '{0}' using agent:hostname_script 
'{1}'".format(cached_hostname, scriptname))
   else:
+logger.warn("Execution of '{0}' failed with exit code {1}. 
err='{2}'\nout='{3}'".format(scriptname, osStat.returncode, err.strip(), 
out.strip()))
 cached_hostname = socket.getfqdn()
+logger.info("Read hostname '{0}' using socket.getfqdn() as '{1}' 
failed".format(cached_hostname, scriptname))
 except:
   cached_hostname = socket.getfqdn()
+  logger.warn("Unexpected error while retrieving hostname: '{0}', 
defaulting to socket.getfqdn()".format(sys.exc_info()))
+  logger.info("Read hostname '{0}' using 
socket.getfqdn().".format(cached_hostname))
   except:
 cached_hostname = socket.getfqdn()
+logger.info("agent:hostname_script configuration not defined thus read 
hostname '{0}' using socket.getfqdn().".format(cached_hostname))
+
   cached_hostname = cached_hostname.lower()
   return cached_hostname