Skip to content

Commit

Permalink
Add a main function to aws.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyklyukin committed Nov 25, 2015
1 parent d150f40 commit 054223c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion patroni/scripts/aws.py
Expand Up @@ -65,8 +65,11 @@ def on_role_change(self, new_role):
return self._tag_ebs(new_role) and ret


if __name__ == '__main__':
def main():
if len(sys.argv) == 4 and sys.argv[1] in ('on_start', 'on_stop', 'on_role_change'):
AWSConnection(cluster_name=sys.argv[3]).on_role_change(sys.argv[2])
else:
sys.exit("Usage: {0} action role name".format(sys.argv[0]))

if __name__ == '__main__':
main()

0 comments on commit 054223c

Please sign in to comment.