-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpacker_arguments.py
61 lines (54 loc) · 3.18 KB
/
packer_arguments.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
def get_packer_arguments(action_name, **action_input):
action_arguments = {"CREATE": {"where":
{"dir": action_input.get("dir"),
"Name": action_input.get("name")},
"Create Mode": action_input.get("create_mode"),
"obj_attributes":
{"mode": 0,
"uid": 0,
"gid": 0,
"size": 0,
"atime": (0, 0),
"mtime": (0, 0)},
},
"LOOKUP": {"what":
{"dir": action_input.get("dir"),
"Name": action_input.get("name")}},
"WRITE": {"file": action_input.get("file"),
"offset": action_input.get("offset"),
"count": action_input.get("count"),
"Stable": action_input.get("stable"),
"Data": action_input.get("data")},
"READDIR": {"dir": action_input.get("dir"),
"cookie": 0,
"Verifier": 0,
"count": 2000},
"READDIRPLUS": {"dir": action_input.get("dir"),
"cookie": 0,
"Verifier": 0,
"count": 2000,
"maxcount": 2000,
},
"LOCK": {"cookie": (4, ''),
"block": action_input.get("block"),
"exclusive": action_input.get("exclusive"),
"lock":
{"caller_name": action_input.get("caller_name"),
"fh": action_input.get("fh"),
"owner": action_input.get("owner"),
"svid": 4,
"l_offset": action_input.get("l_offset"),
"l_len": action_input.get("l_len")},
"reclaim": False,
"state": 3},
"UNLOCK": {"cookie": (4, ''),
"lock":
{"caller_name": action_input.get("caller_name"),
"fh": action_input.get("fh"),
"owner": action_input.get("owner"),
"svid": 4,
"l_offset": action_input.get("l_offset"),
"l_len": action_input.get("l_len")}
}
}
return action_arguments[action_name]