소스 검색

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

Jayush Luniya 10 년 전
부모
커밋
465c20ec21
2개의 변경된 파일8개의 추가작업 그리고 3개의 파일을 삭제
  1. 4 2
      ambari-agent/src/main/python/ambari_agent/Facter.py
  2. 4 1
      ambari-web/app/models/service_config.js

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

@@ -25,8 +25,6 @@ import platform
 import re
 import shlex
 import socket
-import fcntl
-import struct
 import multiprocessing
 import subprocess
 from ambari_commons.shell import shellRunner
@@ -359,6 +357,8 @@ class FacterLinux(Facter):
 
   # Return  netmask
   def getNetmask(self):
+    import fcntl
+    import struct
     primary_ip = self.getIpAddress().strip()
     interface_pattern="(\w+)(?:.*Link encap:)"
     if OSCheck.is_redhat7():
@@ -371,6 +371,8 @@ class FacterLinux(Facter):
       
   # Return IP by interface name
   def get_ip_address_by_ifname(self, ifname):
+    import fcntl
+    import struct
     s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
     return socket.inet_ntoa(fcntl.ioctl(
         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'));
         break;
       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;
       case 'hs_host':
         this.set('value', masterComponentHostsInDB.filterProperty('component', 'HISTORYSERVER').mapProperty('hostName'));