3 from planetstack.config import Config
6 """ A PlanetStack Sync step.
9 psmodel Model name the step synchronizes
10 dependencies list of names of models that must be synchronized first if the current model depends on them
15 sync_config_dir = Config().sync_config_dir
17 sync_config_dir = '/etc/planetstack/sync'
18 prop_config_path = '/'.join(sync_config_dir,self.name,prop)
19 return open(prop_config_path).read().rstrip()
21 def __init__(self, **args):
22 """Initialize a sync step
24 name -- Name of the step
25 provides -- PlanetStack models sync'd by this step
28 self.soft_deadline = int(self.get_prop('soft_deadline_seconds'))
30 self.soft_deadline = 5 # 5 seconds
34 def fetch_pending(self):
35 return Sliver.objects.filter(ip=None)