-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #481 from sudorandom/firmware
Update Firmware CLI/Manager method
- Loading branch information
Showing
7 changed files
with
84 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"""Update firmware.""" | ||
# :license: MIT, see LICENSE for more details. | ||
|
||
import SoftLayer | ||
from SoftLayer.CLI import environment | ||
from SoftLayer.CLI import exceptions | ||
from SoftLayer.CLI import formatting | ||
from SoftLayer.CLI import helpers | ||
|
||
import click | ||
|
||
|
||
@click.command() | ||
@click.argument('identifier') | ||
@environment.pass_env | ||
def cli(env, identifier): | ||
"""Update server firmware.""" | ||
|
||
mgr = SoftLayer.HardwareManager(env.client) | ||
hw_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'hardware') | ||
if env.skip_confirmations or formatting.confirm('This will power off the ' | ||
'server with id %s and ' | ||
'update device firmware. ' | ||
'Continue?' % hw_id): | ||
mgr.update_firmware(hw_id) | ||
else: | ||
raise exceptions.CLIAbort('Aborted.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters