Parcourir la source

AMBARI-10222: Ambari Windows deployment is broken (jluniya)

Jayush Luniya il y a 10 ans
Parent
commit
465c20ec21

+ 4 - 2
ambari-agent/src/main/python/ambari_agent/Facter.py

@@ -25,8 +25,6 @@ import platform
 import re
 import re
 import shlex
 import shlex
 import socket
 import socket
-import fcntl
-import struct
 import multiprocessing
 import multiprocessing
 import subprocess
 import subprocess
 from ambari_commons.shell import shellRunner
 from ambari_commons.shell import shellRunner
@@ -359,6 +357,8 @@ class FacterLinux(Facter):
 
 
   # Return  netmask
   # Return  netmask
   def getNetmask(self):
   def getNetmask(self):
+    import fcntl
+    import struct
     primary_ip = self.getIpAddress().strip()
     primary_ip = self.getIpAddress().strip()
     interface_pattern="(\w+)(?:.*Link encap:)"
     interface_pattern="(\w+)(?:.*Link encap:)"
     if OSCheck.is_redhat7():
     if OSCheck.is_redhat7():
@@ -371,6 +371,8 @@ class FacterLinux(Facter):
       
       
   # Return IP by interface name
   # Return IP by interface name
   def get_ip_address_by_ifname(self, ifname):
   def get_ip_address_by_ifname(self, ifname):
+    import fcntl
+    import struct
     s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
     s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
     return socket.inet_ntoa(fcntl.ioctl(
     return socket.inet_ntoa(fcntl.ioctl(
         s.fileno(),
         s.fileno(),

+ 4 - 1
ambari-web/app/models/service_config.js

@@ -342,7 +342,10 @@ App.ServiceConfigProperty = Em.Object.extend({
         this.set('value', slaveComponentHostsInDB.findProperty('componentName', 'DATANODE').hosts.mapProperty('hostName'));
         this.set('value', slaveComponentHostsInDB.findProperty('componentName', 'DATANODE').hosts.mapProperty('hostName'));
         break;
         break;
       case 'nfsgateway_hosts':
       case 'nfsgateway_hosts':
-        this.set('value', slaveComponentHostsInDB.findProperty('componentName', 'NFS_GATEWAY').hosts.mapProperty('hostName'));
+        var gwyHost = slaveComponentHostsInDB.findProperty('componentName', 'NFS_GATEWAY');
+        if(gwyHost) {
+          this.set('value', gwyHost.hosts.mapProperty('hostName'));
+        }
         break;
         break;
       case 'hs_host':
       case 'hs_host':
         this.set('value', masterComponentHostsInDB.filterProperty('component', 'HISTORYSERVER').mapProperty('hostName'));
         this.set('value', masterComponentHostsInDB.filterProperty('component', 'HISTORYSERVER').mapProperty('hostName'));