Skip to content
This repository was archived by the owner on Sep 23, 2021. It is now read-only.

Commit

Permalink
updated --all to all for simplicity
Browse files Browse the repository at this point in the history
  • Loading branch information
hansehe committed Jan 12, 2019
1 parent ef44888 commit 4d6fc07
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 39 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,33 @@ The application makes it easy to manage a Docker Swarm by configuring a single *
- Deploy/Update or Remove a single stack:
- -> SwarmManagement -stack -deploy `<stack_name>`
- -> SwarmManagement -stack -remove `<stack_name>`
- Or deploy/remove all stacks with the `--all` attribute:
- -> SwarmManagement -stack -deploy --all
- -> SwarmManagement -stack -remove --all
- Or deploy/remove all stacks with the `all` attribute:
- -> SwarmManagement -stack -deploy all
- -> SwarmManagement -stack -remove all
- Create or Remove a single network:
- -> SwarmManagement -network -create `<network_name>`
- -> SwarmManagement -network -remove `<network_name>`
- Or create/remove all networks with the `--all` attribute:
- -> SwarmManagement -network -create --all
- -> SwarmManagement -network -remove --all
- Or create/remove all networks with the `all` attribute:
- -> SwarmManagement -network -create all
- -> SwarmManagement -network -remove all
- Create or Remove a single config:
- -> SwarmManagement -config -create `<config_name>`
- -> SwarmManagement -config -remove `<config_name>`
- Or create/remove all configs with the `--all` attribute:
- -> SwarmManagement -stack -create --all
- -> SwarmManagement -stack -remove --all
- Or create/remove all configs with the `all` attribute:
- -> SwarmManagement -stack -create all
- -> SwarmManagement -stack -remove all
- Create or Remove a single secret:
- -> SwarmManagement -secret -create `<secret_name>`
- -> SwarmManagement -secret -remove `<secret_name>`
- Or create/remove all secrets with the `--all` attribute:
- -> SwarmManagement -secret -create --all
- -> SwarmManagement -secret -remove --all
- Or create/remove all secrets with the `all` attribute:
- -> SwarmManagement -secret -create all
- -> SwarmManagement -secret -remove all
- Create or Remove a single volume:
- -> SwarmManagement -volume -create `<volume_name>`
- -> SwarmManagement -volume -remove `<volume_name>`
- Or create/remove all volumes with the `--all` attribute:
- -> SwarmManagement -volume -create --all
- -> SwarmManagement -volume -remove --all
- Or create/remove all volumes with the `all` attribute:
- -> SwarmManagement -volume -create all
- -> SwarmManagement -volume -remove all
- SwarmManagement uses the `swarm-management.yml` file by default to configure the swarm.
- Specify a single or multiple *.yml files to use for configuring the swarm using the `-f` attribute:
- -> SwarmManagement -start -f swarm-stacks.yml -f swarm-networks.yml
Expand Down
6 changes: 3 additions & 3 deletions SwarmManagement/SwarmConfigs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def GetInfoMsg():
infoMsg += "Example: \r\n"
infoMsg += "configs: <config_name>: <config_file>\r\n"
infoMsg += "Create or remove a config by adding '-config -c/-create <config_name>' or '-config -rm/-remove <config_name>' to the arguments\r\n"
infoMsg += "Create or remove all configs by adding '-config -c/-create --all' or '-config -rm/-remove --all' to the arguments\r\n"
infoMsg += "Create or remove all configs by adding '-config -c/-create all' or '-config -rm/-remove all' to the arguments\r\n"
return infoMsg


Expand All @@ -21,7 +21,7 @@ def GetConfigs(arguments):

def CreateConfigs(configsToCreate, configs):
for configToCreate in configsToCreate:
if configToCreate == '--all':
if configToCreate == 'all':
for config in configs:
CreateConfig(config, configs[config])
else:
Expand All @@ -36,7 +36,7 @@ def CreateConfig(configName, configFile):

def RemoveConfigs(configsToRemove, configs):
for configToRemove in configsToRemove:
if configToRemove == '--all':
if configToRemove == 'all':
for config in configs:
RemoveConfig(config)
else:
Expand Down
18 changes: 9 additions & 9 deletions SwarmManagement/SwarmManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ def GetInfoMsg():

def StartSwarm(arguments):
DockerSwarmTools.StartSwarm()
SwarmVolumes.HandleVolumes(['-volume', '-create', '--all'] + arguments)
SwarmConfigs.HandleConfigs(['-config', '-create', '--all'] + arguments)
SwarmSecrets.HandleSecrets(['-secret', '-create', '--all'] + arguments)
SwarmNetworks.HandleNetworks(['-network', '-create', '--all'] + arguments)
SwarmStacks.HandleStacks(['-stack', '-deploy', '--all'] + arguments)
SwarmVolumes.HandleVolumes(['-volume', '-create', 'all'] + arguments)
SwarmConfigs.HandleConfigs(['-config', '-create', 'all'] + arguments)
SwarmSecrets.HandleSecrets(['-secret', '-create', 'all'] + arguments)
SwarmNetworks.HandleNetworks(['-network', '-create', 'all'] + arguments)
SwarmStacks.HandleStacks(['-stack', '-deploy', 'all'] + arguments)


def StopSwarm(arguments):
SwarmStacks.HandleStacks(['-stack', '-remove', '--all'] + arguments)
SwarmConfigs.HandleConfigs(['-config', '-remove', '--all'] + arguments)
SwarmSecrets.HandleSecrets(['-secret', '-remove', '--all'] + arguments)
# SwarmNetworks.HandleNetworks(['-network', '-remove', '--all'] + arguments)
SwarmStacks.HandleStacks(['-stack', '-remove', 'all'] + arguments)
SwarmConfigs.HandleConfigs(['-config', '-remove', 'all'] + arguments)
SwarmSecrets.HandleSecrets(['-secret', '-remove', 'all'] + arguments)
# SwarmNetworks.HandleNetworks(['-network', '-remove', 'all'] + arguments)


def RestartSwarm(arguments):
Expand Down
6 changes: 3 additions & 3 deletions SwarmManagement/SwarmNetworks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def GetInfoMsg():
infoMsg += "Example: \r\n"
infoMsg += "secrets: <network_name>: true/false\r\n"
infoMsg += "Create or remove a network by adding '-network -c/-create <network_name>' or 'network -rm/-remove <network_name>' to the arguments\r\n"
infoMsg += "Create or remove all networks by adding '-network -c/-create --all' or 'network -rm/-remove --all' to the arguments\r\n"
infoMsg += "Create or remove all networks by adding '-network -c/-create all' or 'network -rm/-remove all' to the arguments\r\n"
return infoMsg


Expand All @@ -21,7 +21,7 @@ def GetNetworks(arguments):

def CreateNetworks(networksToCreate, networks):
for networkToCreate in networksToCreate:
if networkToCreate == '--all':
if networkToCreate == 'all':
for network in networks:
CreateNetwork(network, networks[network])
else:
Expand All @@ -36,7 +36,7 @@ def CreateNetwork(networkName, encrypted):

def RemoveNetworks(networksToRemove, networks):
for networkToRemove in networksToRemove:
if networkToRemove == '--all':
if networkToRemove == 'all':
for network in networks:
RemoveNetwork(network)
else:
Expand Down
6 changes: 3 additions & 3 deletions SwarmManagement/SwarmSecrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def GetInfoMsg():
infoMsg += "Example: \r\n"
infoMsg += "secrets: <secret_name>: <secret_file>\r\n"
infoMsg += "Create or remove a secret by adding '-secret -c/-create <secret_name>' or 'secret -rm/-remove <secret_name>' to the arguments\r\n"
infoMsg += "Create or remove all secrets by adding '-secret -c/-create --all' or 'secret -rm/-remove --all' to the arguments\r\n"
infoMsg += "Create or remove all secrets by adding '-secret -c/-create all' or 'secret -rm/-remove all' to the arguments\r\n"
return infoMsg


Expand All @@ -21,7 +21,7 @@ def GetSecrets(arguments):

def CreateSecrets(secretsToCreate, secrets):
for secretToCreate in secretsToCreate:
if secretToCreate == '--all':
if secretToCreate == 'all':
for secret in secrets:
CreateSecret(secret, secrets[secret])
else:
Expand All @@ -36,7 +36,7 @@ def CreateSecret(secretName, secretFile):

def RemoveSecrets(secretsToRemove, secrets):
for secretToRemove in secretsToRemove:
if secretToRemove == '--all':
if secretToRemove == 'all':
for secret in secrets:
RemoveSecret(secret)
else:
Expand Down
6 changes: 3 additions & 3 deletions SwarmManagement/SwarmStacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def GetInfoMsg():
infoMsg += "Example: \r\n"
infoMsg += "stacks: <stack_name>: <compose_file>\r\n"
infoMsg += "Deploy or remove a stack by adding '-stack -d/-deploy <stack_name>' or 'stack -rm/-remove <stack_name>' to the arguments\r\n"
infoMsg += "Deploy or remove all stacks by adding '-stack -d/-deploy --all' or 'stack -rm/-remove --all' to the arguments\r\n"
infoMsg += "Deploy or remove all stacks by adding '-stack -d/-deploy all' or 'stack -rm/-remove all' to the arguments\r\n"
return infoMsg


Expand All @@ -21,7 +21,7 @@ def GetStacks(arguments):

def DeployStacks(stacksToDeploy, stacks, environmentFiles):
for stackToDeploy in stacksToDeploy:
if stackToDeploy == '--all':
if stackToDeploy == 'all':
for stack in stacks:
DeployStack(stack, stacks[stack], environmentFiles)
else:
Expand All @@ -36,7 +36,7 @@ def DeployStack(stackName, composeFile, environmentFiles):

def RemoveStacks(stacksToRemove, stacks):
for stackToRemove in stacksToRemove:
if stackToRemove == '--all':
if stackToRemove == 'all':
for stack in stacks:
RemoveStack(stack)
else:
Expand Down
6 changes: 3 additions & 3 deletions SwarmManagement/SwarmVolumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def GetInfoMsg():
infoMsg += "Example: \r\n"
infoMsg += "volumes: <volume_name>:\r\n"
infoMsg += "Create or remove a volume by adding '-volume -c/-create <volume_name>' or '-volume -rm/-remove <volume_name>' to the arguments\r\n"
infoMsg += "Create or remove all volumes by adding '-volume -c/-create --all' or '-volume -rm/-remove --all' to the arguments\r\n"
infoMsg += "Create or remove all volumes by adding '-volume -c/-create all' or '-volume -rm/-remove all' to the arguments\r\n"
return infoMsg


Expand All @@ -21,7 +21,7 @@ def GetVolumes(arguments):

def CreateVolumes(volumesToCreate, volumes):
for volumeToCreate in volumesToCreate:
if volumeToCreate == '--all':
if volumeToCreate == 'all':
for volume in volumes:
CreateVolume(volume)
else:
Expand All @@ -35,7 +35,7 @@ def CreateVolume(volumeName):

def RemoveVolumes(volumesToRemove, volumes):
for volumeToRemove in volumesToRemove:
if volumeToRemove == '--all':
if volumeToRemove == 'all':
for volume in volumes:
RemoveVolume(volume)
else:
Expand Down

0 comments on commit 4d6fc07

Please sign in to comment.