11 Commits

Author SHA1 Message Date
Yasin, Siraj (SY495P)
c25d223c7b Add copyright for missing files
* added license templates for go, bash & yaml in tools dir
* added a script that will add license information for all
    missing files. Type:  go, yaml, yml, sh
* skip adding license for all files within testdata
* Syntax:
   > ./tools/add_license.sh

* Skip license for manifests folder
* Added one extra line after licene for yaml files
* Added License after Hashbang for bash.
* Add an extra line after hashbang and before license
* Updated the go template to use multiline comments

New Files:
  1. tools/add_license.sh
  2. tools/license_go.txt
  3. tools/license_yaml.txt
  4. tools/license_bash.txt

Change-Id: Ia4da5b261e7cd518d446896b72c810421877472a
Realtes-To:#147
2020-04-09 08:35:59 -05:00
Drew Walters
a15f978cad Use new Redfish client
The remote package in airshipctl is tightly coupled to redfish. In the
future, we may need to introduce IPMI or SMASH; however, adding those
clients now would be difficult because of our tight dependence on
redfish. This change implements usage of the new Redfish client, which
implements the generic remote client. It also separates remoteDirect
functionality from the redfish package in order to make it more loosely
coupled.

Relates #5
Closes #122

Change-Id: I45d4ea6e2a4146ea519e94ea701a3ad527e50ca0
Signed-off-by: Drew Walters <andrew.walters@att.com>
2020-04-03 18:10:53 +00:00
Ian Howell
68ec25db22 Reduce the complexity of ScreenRedfishError
Change-Id: I69b7e546cd814f5e3b6b890348f4e808058ae6ef
Relates-To: #142
2020-04-01 15:34:51 -05:00
Drew Walters
ddd0f389be Fix Redfish error handling logic
A logic error in the ScreenRedfishError function causes a false success
if there is no error unmarshalling the body of a GenericOpenAPIError.
This change corrects the logic error and modifies some status checks to
use the http library constants for readability.

This functionality remains untested. The body field of the
GenericOpenAPI error is unexported; therefore, it is inaccessible to our
unit tests.

Fixes: #142

Change-Id: Ic9f248c239830e0b6013a2e2c5d74ea4d2ef25af
Signed-off-by: Drew Walters <andrew.walters@att.com>
2020-04-01 14:42:52 +00:00
Dmitry Ukov
2817df8482 Ensure node power state ON/OFF for Reset command
Change-Id: Icc6b18b4694a17ab2f8e0bf1112e41a1d18a5b00
Relates-To: #54
Depends-On: https://review.opendev.org/713622
2020-03-19 09:53:58 +04:00
Drew Walters
4ba23313c5 [#52] Provide Redfish feedback in RemoteDirect
Currently, errors thrown by RemoteDirect are simply HTTP status codes
from the Redfish client HTTP requests. This change adds feedback to
RemoteDirect errors when the Redfish client provides error feedback.

Closes #52

Change-Id: I4441baf3b98405e92613a2d4e8c44ef63a5d4001
Signed-off-by: Drew Walters <andrew.walters@att.com>
2020-03-17 16:38:41 +00:00
Drew Walters
0cf1068c5f Refactor Redfish ClientError
This change refactors the Redfish ClientError to match the error pattern
used elsewhere in airshipctl.

Change-Id: Ie309ba9ac41e5b618cf2f4c18f1f381d875e9cdb
Signed-off-by: Drew Walters <andrew.walters@att.com>
2020-03-17 16:36:08 +00:00
Alexander Hughes
2bf3117197 [#58] Update types for golint
This patch addresses guidance from effective go [0] and golint
failures such as:

pkg/document/document.go:8:6: type name will be used as
document.DocumentFactory by other packages, and that stutters; consider
calling this Factory
pkg/remote/errors.go:9:6: type name will be used as
remote.RemoteDirectError by other packages, and that stutters; consider
calling this DirectError
pkg/remote/remote_direct.go:27:6: type name will be used as
remote.RemoteDirectClient by other packages, and that stutters; consider
calling this DirectClient
pkg/remote/redfish/errors.go:10:6: type name will be used as
redfish.RedfishClientError by other packages, and that stutters;
consider calling this ClientError
pkg/remote/redfish/redfish.go:14:6: type name will be used as
redfish.RedfishRemoteDirect by other packages, and that stutters;
consider calling this RemoteDirect

[0] https://golang.org/doc/effective_go.html#package-names

Relates-To: #58

Change-Id: I6d94da7755c8719bbcc4a77917e283074281309a
Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
2020-03-03 01:41:43 +00:00
Alexander Hughes
7bfdea075e [#12] Implement RedfishConfigError interface
Implement RedfishConfigError
Rename RedfishConfigError to follow airship norms IE ErrRedfish...
Update unit tests

Change-Id: I49051315460b5d261186f32bae6101a752740eae
2020-02-12 21:29:58 +00:00
Dmitry Ukov
c1ed28fd25 Move all error structs to common package 'errors'
Change-Id: I91e9610b27244fe5d7500575eae24647e256dab8
2019-12-01 14:14:09 +04:00
Kanwar Saad Bin Liaqat
3bf54274c3 Bootstrap redfish Remote direct
This commit implements redfish remote direct subcommand
under bootstrap.

Change-Id: Idf97445f6fa59a77145eae1edaa15b1d22723f19
Signed-off-by: Kanwar Saad Bin Liaqat <kanwar.sbl@gmail.com>
2019-11-01 02:41:38 +02:00