|
19 | 19 | import java.security.NoSuchAlgorithmException; |
20 | 20 | import java.security.SecureRandom; |
21 | 21 | import java.util.ArrayList; |
| 22 | +import java.util.Arrays; |
22 | 23 | import java.util.List; |
23 | 24 | import java.util.Map; |
24 | 25 | import java.util.UUID; |
25 | 26 |
|
26 | 27 | import javax.inject.Inject; |
27 | 28 |
|
28 | | -import org.apache.cloudstack.api.*; |
| 29 | +import org.apache.cloudstack.api.APICommand; |
| 30 | +import org.apache.cloudstack.api.ApiConstants; |
| 31 | +import org.apache.cloudstack.api.ApiErrorCode; |
| 32 | +import org.apache.cloudstack.api.BaseListCmd; |
| 33 | +import org.apache.cloudstack.api.Parameter; |
| 34 | +import org.apache.cloudstack.api.ServerApiException; |
29 | 35 | import org.apache.cloudstack.api.response.DomainResponse; |
30 | 36 | import org.apache.cloudstack.api.response.LdapUserResponse; |
31 | 37 | import org.apache.cloudstack.api.response.ListResponse; |
|
37 | 43 | import org.bouncycastle.util.encoders.Base64; |
38 | 44 |
|
39 | 45 | import com.cloud.domain.Domain; |
40 | | -import com.cloud.exception.*; |
| 46 | +import com.cloud.exception.ConcurrentOperationException; |
| 47 | +import com.cloud.exception.InsufficientCapacityException; |
| 48 | +import com.cloud.exception.InvalidParameterValueException; |
| 49 | +import com.cloud.exception.NetworkRuleConflictException; |
| 50 | +import com.cloud.exception.ResourceAllocationException; |
| 51 | +import com.cloud.exception.ResourceUnavailableException; |
41 | 52 | import com.cloud.user.AccountService; |
42 | 53 | import com.cloud.user.DomainService; |
43 | 54 |
|
@@ -175,7 +186,7 @@ private String generatePassword() throws ServerApiException { |
175 | 186 | final SecureRandom randomGen = SecureRandom.getInstance("SHA1PRNG"); |
176 | 187 | final byte bytes[] = new byte[20]; |
177 | 188 | randomGen.nextBytes(bytes); |
178 | | - return Base64.encode(bytes).toString(); |
| 189 | + return Arrays.toString(Base64.encode(bytes)); |
179 | 190 | } catch (final NoSuchAlgorithmException e) { |
180 | 191 | throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to generate random password"); |
181 | 192 | } |
|
0 commit comments