Revision 82b22e19 lib/jqueue.py
b/lib/jqueue.py | ||
---|---|---|
53 | 53 |
from ganeti import utils |
54 | 54 |
from ganeti import jstore |
55 | 55 |
from ganeti import rpc |
56 |
from ganeti import runtime |
|
56 | 57 |
from ganeti import netutils |
57 | 58 |
from ganeti import compat |
58 | 59 |
|
... | ... | |
1070 | 1071 |
@param replicate: whether to spread the changes to the remote nodes |
1071 | 1072 |
|
1072 | 1073 |
""" |
1073 |
utils.WriteFile(file_name, data=data) |
|
1074 |
getents = runtime.GetEnts() |
|
1075 |
utils.WriteFile(file_name, data=data, uid=getents.masterd_uid, |
|
1076 |
gid=getents.masterd_gid) |
|
1074 | 1077 |
|
1075 | 1078 |
if replicate: |
1076 | 1079 |
names, addrs = self._GetNodeIp() |
... | ... | |
1314 | 1317 |
@param drain_flag: Whether to set or unset the drain flag |
1315 | 1318 |
|
1316 | 1319 |
""" |
1320 |
getents = runtime.GetEnts() |
|
1321 |
|
|
1317 | 1322 |
if drain_flag: |
1318 |
utils.WriteFile(constants.JOB_QUEUE_DRAIN_FILE, data="", close=True) |
|
1323 |
utils.WriteFile(constants.JOB_QUEUE_DRAIN_FILE, data="", close=True, |
|
1324 |
uid=getents.masterd_uid, gid=getents.masterd_gid) |
|
1319 | 1325 |
else: |
1320 | 1326 |
utils.RemoveFile(constants.JOB_QUEUE_DRAIN_FILE) |
1321 | 1327 |
|
Also available in: Unified diff