updated emane config files to be generated for remote servers, fixed services not using node remote server compatible commands

This commit is contained in:
Blake Harnden 2019-10-10 11:53:52 -07:00
parent a4b6b8be51
commit bc58693339
7 changed files with 184 additions and 39 deletions

View file

@ -11,7 +11,6 @@ import string
import threading
from builtins import range
from socket import AF_INET, AF_INET6
from tempfile import NamedTemporaryFile
from core import constants, utils
from core.emulator import distributed
@ -997,11 +996,8 @@ class CoreNode(CoreNodeBase):
open_file.write(contents)
os.chmod(open_file.name, mode)
else:
temp = NamedTemporaryFile(delete=False)
temp.write(contents.encode("utf-8"))
temp.close()
self.net_cmd(["mkdir", "-m", "%o" % 0o755, "-p", dirname])
distributed.remote_put(self.server, temp.name, hostfilename)
distributed.remote_put_temp(self.server, hostfilename, contents)
self.net_cmd(["chmod", "%o" % mode, hostfilename])
logging.debug(
"node(%s) added file: %s; mode: 0%o", self.name, hostfilename, mode